db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Trent Rosenbaum" <trent.j.rosenb...@gmail.com>
Subject Returning DatabaseMetaData for Derby Synonyms
Date Wed, 26 Jul 2006 15:31:18 GMT
Hi there,

A project I am working on is using Derby database and contains a
number of synonyms and regular tables.
There is a certain situation that requries us to determine if a name
represents a real table or synonym.
The following code is used:

// Filter the metadata to only return results relating to Synonyms.
String[] types = {"SYNONYM"};

// Return the current metadata and use the table name to narrow the table
DatabaseMetaData metaData = DatabaseManager.getConnection().getMetaData();
tablesResults = metaData.getTables(null, metaData.getUserName(), tableName,

// If there is a result then the table name represented a synonym.
while (tablesResults.next()) {
result = true;

I have been able to use this code against an Oracle database to identify if
a table name represents a synonym.
I did a search and saw that support for synonyms was put into Derby August
2005.  Has anyone else tried to return
a DatabaseMetaData instance from Derby?

Does anyone have thoughts on this subject or suggestions?

Many thanks

View raw message