stmt = conn.createStatement();
// Query the table
rs = stmt.executeQuery(sqlString);
RowInfo header = new RowInfo(table, rs.getMetaData());
header.setCatalog(catalog);
header.setSchema(schema);
header.setTable(table);
ti.setHeader(header);
DAOUtil.closeResultSet(rs);
//set more properties
DatabaseMetaData dbmd = conn.getMetaData();
rs2 = dbmd.getColumns(toUpperCaseIfAllowed(dba, catalog),
toUpperCaseIfAllowed(dba, schema),
toUpperCaseIfAllowed(dba, table), (String)null);
header.setResultSetMetaDataForTable(rs2);
// set some table properties
//ti.setSchema(ti.getHeader().getColumnInfo(0).getSchemaName());
//ti.setCatalog(ti.getHeader().getColumnInfo(0).getCatalogName());
// get primary keys
if (!header.hasPrimaryKey()) {
PrimaryKey pk = lookupPrimaryKey(dba, conn, catalog, schema, table);
if (pk != null) header.setPrimaryKeyColumns(pk.getColumns());
}
}
finally {
DAOUtil.closeResultSet(rs);
DAOUtil.closeResultSet(rs2);