rs.close();
}
}
catch (SQLException sqle)
{
throw new JPOXDataStoreException("Exception thrown obtaining schema table information from datastore", sqle);
}
// Retrieve column info
try
{
// Get columns for this catalog, schema
Connection conn = (Connection)mconn.getConnection();
ResultSet rs = ((RDBMSAdapter)storeMgr.getDatastoreAdapter()).getColumns(conn,
storeMgr.getCatalogName(), storeMgr.getSchemaName(), null);
while (rs.next())
{
// Construct a fully-qualified name for the table in this row of the ResultSet
String tableIdentifierCatalogName = rs.getString(1);
String tableIdentifierSchemaName = rs.getString(2);
String tableIdentifierTableName = rs.getString(3);
if (rs.wasNull() ||
(tableIdentifierCatalogName != null && tableIdentifierCatalogName.length() < 1))
{
tableIdentifierCatalogName = null;
}
if (rs.wasNull() ||
(tableIdentifierSchemaName != null && tableIdentifierSchemaName.length() < 1))
{
tableIdentifierSchemaName = null;
}
if (rs.wasNull() ||
(tableIdentifierTableName != null && tableIdentifierTableName.length() < 1))
{
tableIdentifierTableName = null;
}
//at least the JDBC driver should return the table name
if (tableIdentifierTableName == null)
{
throw new JPOXDataStoreException("Invalid 'null' table name identifier returned by database. Check with your JDBC driver vendor (ref:DatabaseMetaData.getColumns).");
}
// TODO This should create RDBMSColumnInfo
((RDBMSAdapter)storeMgr.getDatastoreAdapter()).newColumnInfo(rs);
}
}
catch (SQLException sqle)
{
throw new JPOXDataStoreException("Exception thrown obtaining schema column information from datastore", sqle);
}
schemaDataByName.put("tables", schema);
}