This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes JDBC and the fly likes Problem accessing MetaData with DB2 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Reply 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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Problem accessing MetaData with DB2
 
Similar Threads
Empty SQLException on attempt to run a stored procedure
Connection Busy with another result hstmt Error - updated (SOLVED WITH JTDS)
Resultset + TYPE_FORWARD_ONLY problem
Tomcat and jdbc/odbc
JDBC Sybase Stored Procedure Exception