Subject Re: [Firebird-Java] Jaybird 2.2.0 issue
Author Mark Rotteveel
On 15-11-2012 10:33, hugo.larson wrote:
> Hello,
>
> I'm using Jbuilder DataExpress together with Jaybird 2.1.6 and FB 1.5.3
>
> I tried the new version and something seems have to happened with the metadata discovery. It wont recognize the server column names as they were in older jaybird
>
> Has there been any change with the metadata?

Assuming you are talking about ResultSet.getColumnName(...), then yes.
It is documented in the releasenotes under 'Other fixes and changes' and
in section 'Compatibility with com.sun.rowset.*'.

To quote from the 2.2.1 releasenotes:
"
FBResultSetMetaData#getcolumnName(int) will now return the original
column name (if available) for compliance with the JDBC specification,
getColumnLabel(int) will still return the alias (or the column name if
no alias is defined). See Compatibility with com.sun.rowset.* for
potential problems when using the reference implementation of CachedRowSet.
Jaybird 2.2.1 introduced the connection property columnLabelForName
which will revert to the old behavior when set to true. Be aware that
the old behavior is not JDBC-compliant.
"

I advice you to switch to getColumnLabel(..) as that is the proper JDBC
method for discovering the resultset metadata. The method
getColumnName(..) is intended to discover the name of the original
column in the table returned from getTableName(..) (ie if you want to
discover what column in what table would need to be changed).

If for some reason you can't switch to use getColumnLabel(..), then
upgrade to Jaybird 2.2.1 and use the connection property
columnLabelForName=true.

See also http://tracker.firebirdsql.org/browse/JDBC-162 and the linked
issues.

Mark
--
Mark Rotteveel