This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes Jdbc 2 Driver for DB2/UDB does not work Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Jdbc 2 Driver for DB2/UDB does not work" Watch "Jdbc 2 Driver for DB2/UDB does not work" New topic
Author

Jdbc 2 Driver for DB2/UDB does not work

prabhusub
Greenhorn

Joined: Aug 17, 2001
Posts: 2
Hi,
The JDBC 2 Driver for DB2/UDB does not work..
I am using DB2 Client 7 fixpack 3..
The code is as below :
Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");
Connection conn = DriverManager.getConnection("jdbc:db2:Z1U2", "user", "pwd");
Statement st = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
//Statement st = conn.createStatement();
ResultSet rs = st.executeQuery("select * from table");
while (rs.next()) {
System.out.println(rs.getString(1) + " - " + rs.getString(2));
}
The records are not retrieved, if the the scroll type and the concurrency are mentioned while creating the statement
Statement st = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
But are retrieved if no parameters are mentioned while creating the statement..
Statement st = conn.createStatement();
No exceptions are thrown...
rs.next() returns false in the first case, true in the second case
Can anyone help me out....
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

does your driver documentation state whether they fully implement these features? Some drivers don't implement scrollable resultsets , but don't give you compiler/run time errors, just ignore the statement.
Jamie
[This message has been edited by Jamie Robertson (edited September 18, 2001).]
 
wood burning stoves
 
subject: Jdbc 2 Driver for DB2/UDB does not work
 
Similar Threads
Some problem with JDBC - Oracle when using awt
multiple rows problem
How to find the number of rows in a Resultset object
while loop in a while loop
Problem getting the number of rows in a ResultSet