I want to run a query in an Oracle database and for each column in the result set, I want to know the schema from which the column came. I tried the following:
ResultSetMetaData rsMetadata = rs.getMetaData();
String schemaName = rsMetadata.getSchemaName(1)
However, this returns an empty string. Is there any work to get the schema name?
Edit in response to OMG Ponies:
The tool we are developing takes data from a database and analyzes the data to find the most informative subset for this issue. Then we create a query that returns only rows that are informative for the given question. For example, if we had a customer database and we wanted to find out which customers are most likely to stop serving, our tool can create a query that returns 5% of customer records, which can then be executed using powerful analysis algorithms. The advantage is that we conduct our analysis only with a subset of the data, which, of course, will save time. It also turns out that high-performance analytics algorithms now work better, because the first step was basically filtering out noise from our data.
Thus, in response to OMG Ponies, the user indicates information about connecting to the database and the request as a contribution to our tool. Since they can specify any query that they like, they could connect to the foo schema connection and then run the following query:
SELECT* FROM bar.customer;
If, for some reason, eye color and gender were predictors of people stopping their service, the resulting query that our system generates might look like this:
SELECT * FROM bar.customer WHERE bar.customer.eye_color='blue'
AND bar.customer.gender='M'
, , . , , , , 99% . , 1% - , , .