wood burning stoves 2.0*
The moose likes JDBC 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
Bookmark "Problem accessing MetaData with DB2 " Watch "Problem accessing MetaData with DB2 " New topic
Author

Problem accessing MetaData with DB2

Ankit C
Greenhorn

Joined: Sep 25, 2002
Posts: 2
Hi,
I am using
COM.ibm.db2.jdbc.app.DB2Driver 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
Ankit
Axel Janssen
Ranch Hand

Joined: Jan 08, 2001
Posts: 2164
Hi,
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.
Axel
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem accessing MetaData with DB2