I found there is some problem in Oracle 11g
to get table name from interface(ResultSet.getMetaData().getTableName(int column));
It always show the empty string.
Is there something wrong for oracle database or jdbc driver? If the jdbc driver's problem , Can I get another jdbc driver to resolve this issue?
Thanks in advance!
You can get the name of a particular column using the getColumnName() method of the ResultSetMetadata interface. This method accepts an integer value representing the index of a column and returns a String value representing the name of the specified column.
Retrieves the Statement object that produced this ResultSet object. String. getString(int columnIndex) Retrieves the value of the designated column in the current row of this ResultSet object as a String in the Java programming language.
The ResultSet interface declares getter methods (for example, getBoolean and getLong ) for retrieving column values from the current row. You can retrieve values using either the index number of the column or the alias or name of the column. The column index is usually more efficient. Columns are numbered from 1.
According to the documentation this is not supported:
but does not implement the
getSchemaName
andgetTableName
methods because Oracle Database does not make this feasible
Earlier Oracle drivers did have this feature, but it needed to be enabled explicitly because of its performance implications. As far as I can tell from the documentation this is no longer available in more recent drivers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With