File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Problem accessing MetaData with DB2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Problem accessing MetaData with DB2 " Watch "Problem accessing MetaData with DB2 " New topic

Problem accessing MetaData with DB2

Ankit C

Joined: Sep 25, 2002
Posts: 2
I am using for my application.
I am having problem when I try to access Database MetaData. When I call metaData.getTables() I get an empty ResultSet and when I call metaData.getSchemas() I get SQLException.
The java.sql.DatabaseMetaData interface documentation clearly states that
"An SQLException will be thrown if a driver does not support a meta data method. In the case of methods that return a ResultSet, either a ResultSet (which may be empty) is returned or a SQLException is thrown."
Is there any Driver available which supports these (getTables and getSchemas) methods.
Thanks in advance
Axel Janssen
Ranch Hand

Joined: Jan 08, 2001
Posts: 2164
if I remember right, DB2 ships with 2 different jdbc drivers, with the older java1.1 compatible being default.
You can activate the newer java1.2 compatible driver with running usejdbc2.bat, which is in SQLLIB\java12 directory.
Not sure, correct me if I am wrong, hope it helps.
I agree. Here's the link:
subject: Problem accessing MetaData with DB2
It's not a secret anymore!