getSchemas() method returning empty resultset
Posted by: Santhosh K
Date: March 06, 2012 08:48AM

Hi,

MySQL version I am using is this - Server version: 5.5.21 MySQL Community Server (GPL)

The JDBC Driver version is this - mysql-connector-java-5.1.18

I am trying to get a list of schemas by using the DatabaseMetaData.getSchemas() method of the driver. But, this is returning an empty resultset.
Can someone here throw some light on this, as to why this is happening.


Here's the code snippet that I am using,

Class.forName("com.mysql.jdbc.Driver");

Connection conn = (Connection) DriverManager.getConnection ("jdbc:mysql://abc.xyy.xyz.com:3306/hellodb", "root", "root");

DatabaseMetaData meta = (com.mysql.jdbc.DatabaseMetaData) conn.getMetaData();

schemas = meta.getSchemas();

if (!schemas.next())
System.out.println("No schemas found...." + schemas);
Here, the schemas.next() returns false, indicating that the schemas is an empty resultset.

Am I missing something here or something wrong with the driver ?
Any help on this is appreciated.

Thanks in advance.
Santhosh

Options: ReplyQuote


Subject
Written By
Posted
getSchemas() method returning empty resultset
March 06, 2012 08:48AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.