db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Olivier Chedru" <oChe...@infovista.com>
Subject RE: List existing databases
Date Thu, 26 Jul 2007 14:17:03 GMT
Oops, looks like I did not read the question well: I understood
"database tables" instead of "databases".

 

 

From: Olivier Chedru [mailto:oChedru@infovista.com] 
Sent: Thursday, July 26, 2007 12:25 PM
To: Derby Discussion
Subject: RE: List existing databases

 

Hi Nuno,

 

Try using DatabaseMetaData given a connection to your Derby database.
For example :

 

final DatabaseMetaData dmd = connection.getMetaData();

final String schema = "your_schema";

final String[] typeTable = { "TABLE" };

final ResultSet schemaTables = dmd.getTables(null, schema,

                                null, typeTable);

while (schemaTables.next()) {

                String tableName = schemaTables.getString(3));

                System.out.println(tableName);

}

 

 

From: Nuno Carvalho [mailto:nunomrc@di.fc.ul.pt] 
Sent: Thursday, July 26, 2007 12:14 PM
To: Derby Discussion; derby-dev@db.apache.org
Subject: List existing databases

 

Hi all,

 

I need to list the existing databases of derby. Can someone help me on
this? Is there a way to query the list of available created databases or
is this information is this information available inside the derby
engine?

 

Any help would be appreciated.

 

Best regards,

--

Nuno Carvalho

University of Lisbon, Portugal

http://lasige.di.fc.ul.pt/~ncarvalho

 

 

 


Mime
View raw message