[prev in list] [next in list] [prev in thread] [next in thread]
List: mysql-java
Subject: =?iso-8859-1?Q?R=E9f=2E_=3A_Help_reqd=21?=
From: jeanyves.beaujean () corman ! be
Date: 2003-10-13 6:58:02
[Download RAW message or body]
--=_alternative 00266F34C1256DBE_=
Content-Type: text/plain; charset="us-ascii"
Hi,
You must use DatabaseMetaData like this
try
{
DatabaseMetaData dmtd = yourconnection.getMetaData();
ResultSet res = dmtd.getCatalogs();
while ( res.next() )
{
StringBuffer line = new StringBuffer();
// there is only one field in the resultset : TABLE_CAT (String) = catalog
name
System.out.println(res.getString(1));
}
}
catch ( SQLException e ) { System.err.println("ERROR : "+ e ); }
Jean-Yves Beaujean
Service informatique
CORMAN S.A.
"P.V.Srikanth" <P.V.Srikanth@delphi.com>
13/10/2003 06:15
Pour : java@lists.mysql.com
cc :
Objet : Help reqd!
Hi All,
I want to know how can we get a list of all the databases found on a
specified mysql database server through JDBC code.
It would be of great help if you could send me details.
Thanks in advance.
Thanks & Regards
Srikanth
--
MySQL Java Mailing List
For list archives: http://lists.mysql.com/java
To unsubscribe: http://lists.mysql.com/java?unsub=jeanyves.beaujean@corman.be
--=_alternative 00266F34C1256DBE_=--
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic