public void crossCheckGetColumnRowAndResultSetMetaData(
ResultSet rs, ResultSetMetaData rsmdt, int odbc)
throws Exception
{
int col = rs.getInt("ORDINAL_POSITION");
Version dataVersion = getDataVersion( getConnection() );
assertEquals("RSMD.getCatalogName",
rsmdt.getCatalogName(col), rs.getString("TABLE_CAT"));
assertEquals("RSMD.getSchemaName",
rsmdt.getSchemaName(col), rs.getString("TABLE_SCHEM"));
assertEquals("RSMD.getTableName",
rsmdt.getTableName(col), rs.getString("TABLE_NAME"));
assertEquals("COLUMN_NAME",
rsmdt.getColumnName(col), rs.getString("COLUMN_NAME"));
// DERBY-2285 BOOLEAN columns appear different on
// network client.
// DMD returns BOOLEAN
// RSMD returns SMALLINT
int dmdColumnType = rs.getInt("DATA_TYPE");
if (dmdColumnType == Types.BOOLEAN && usingDerbyNetClient())
{
assertEquals("TYPE_NAME",
"BOOLEAN", rs.getString("TYPE_NAME"));
assertEquals("TYPE_NAME",
"SMALLINT", rsmdt.getColumnTypeName(col));
assertEquals("DATA_TYPE",
Types.SMALLINT, rsmdt.getColumnType(col));
}
else if (dmdColumnType == Types.JAVA_OBJECT && usingDerbyNetClient()
&& ( dataVersion.compareTo( new Version( 10, 6, 0, 0 ) ) < 0 ) )
{
// DMD returns JAVA_OBJECT
// RSMD returns LONGVARBINARY!
assertEquals("DATA_TYPE",
Types.LONGVARBINARY, rsmdt.getColumnType(col));