Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > DB2 > jdbc1 vs. jdbc2 errors help!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-14-02, 14:20
inter0p inter0p is offline
Registered User
 
Join Date: Jan 2002
Posts: 1
Exclamation jdbc1 vs. jdbc2 errors help!

Hi,
We are on db2 7.2 on win2k and were using the JDBC1 drivers and all was
working fine. We just switched to the JDBC2 driver and now are seeing tons
of errors that we never saw before.

Example code that works in db2 jdbc1 driver.

// get statement
op = con.prepareStatement(sql);

try {
rs = op.executeQuery();
}
catch (SQLException e) {
log("Die on executing statement in genericSqlGet()"+ sql,e);
}

// build result collection
try {
while (rs.next()) {
.............
..........


However when switching to db2's JDBC2 driver we get the following exception
when calling rs.next() (note the executeQuery() and prepareStatement() throw
no execeptions.

EXCEPTION: COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/NT]
SQL0501N The cursor specified in a FETCH or CLOSE statement is not open.
SQLSTATE=24501

COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/NT] SQL0501N The
cursor specified in a FETCH or CLOSE statement is not open. SQLSTATE=24501

at
COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_S QLException(SQLExceptionGe
nerator.java:254)
at
COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_S QLException(SQLExceptionGe
nerator.java:197)
at
COM.ibm.db2.jdbc.app.SQLExceptionGenerator.check_r eturn_code(SQLExceptionGen
erator.java:436)
at COM.ibm.db2.jdbc.app.DB2ResultSet.next(DB2ResultSe t.java:473)
Reply With Quote
  #2 (permalink)  
Old 01-29-02, 09:05
gubo gubo is offline
Registered User
 
Join Date: Jan 2002
Posts: 6
Unhappy

we are using JDBC 2 driver and have never experienced this error. I have checked your piece of source against our sources and I dont see a problem. Are you sure the Exception occurs in this piece of code ??
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On