473,326 Members | 2,148 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

db2jcc driver issue with getting an empty resultset

I have a java web application that is using the db2jcc driver to get a
connection to a DB2 database that is located on an RS 6000 server.

The here is a portion of the code that is giving me a problem.

rs is an ResultSet object instantiated by the following...

detailStmt = vmCon.prepareStatement(detailSelect);

detailResults = detailStmt.executeQuery();

if (rs.next())
{
do something
}

now when the resultset returns any records the code performs fine.
when it returns an empty resultset it throws the following exception

com.ibm.db2.jcc.a.SqlException: Invalid operation: result set closed

the web app is running on a RS 6000 server as well...

we are running the app in websphere WAS 5.0 environment.
does anyone have any clue as to what could be causing this problem?
Thanks

Nov 12 '05 #1
1 4271


ra******@yahoo.com wrote:
I have a java web application that is using the db2jcc driver to get a
connection to a DB2 database that is located on an RS 6000 server.

The here is a portion of the code that is giving me a problem.

rs is an ResultSet object instantiated by the following...

detailStmt = vmCon.prepareStatement(detailSelect);

detailResults = detailStmt.executeQuery();

if (rs.next())
{
do something
}

now when the resultset returns any records the code performs fine.
when it returns an empty resultset it throws the following exception

com.ibm.db2.jcc.a.SqlException: Invalid operation: result set closed

the web app is running on a RS 6000 server as well...

we are running the app in websphere WAS 5.0 environment.

does anyone have any clue as to what could be causing this problem?
Thanks


As long as the SQL in detailSelect always does a real query, your
executeQuery() call should always return a valid result set. It may
be empty, in which case the first call to next() should return false.
At what line do you get the SQLException?
Are you sure this code is threadsafe? If the statement is somehow
re-executed or closed by another thread, you can get the exception
you see. I hope your jdbc objects are method-level objects, not
instance variables.

Joe Weinstein at BEA

Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Dani | last post by:
Hi everyone Description of the problem: Using a PreparedStatement to write down an integer (int) plus a timestamp for testing purposes. When read out again the integer looks very different. We...
3
by: robert | last post by:
don't find any mention on either udb/APARS or 390/APARS. since upgrading 390 to 7.1.1 over the weekend, the following now happens, when run from udb to 390: .... Statement stmt =...
7
by: Rhino | last post by:
I was reading the DB2 for Linux/Unix/Windows (V7.2) manuals just now to get some background information about UDFs when I came across this: "Note that valuable debugging tools such as printf() do...
15
by: Joe Weinstein | last post by:
Hi. Below is a simple JDBC program to insert and extract a numerical value. When ResultSet.getDouble() is called, the same program produces different output on solaris than it does on Linux. I...
12
by: robertino | last post by:
Hi all, I've put together a few SPs to produce a BOM (bill of materials) listing, which together use a couple of global temp tables, and return the results from a cursor. Here's the code: ...
1
by: db2group88 | last post by:
Hi, we are using db2 ESE v8.2.3 on windows, i try to use command window to do binding D:\Program Files\IBM\SQLLIB\bnd>java -cp "D:\program files\ibm\sqllib \java\db2jcc.jar"...
1
by: chihfei.lai | last post by:
Hi all, As title!! My development environment is db2 v8.1. But my production environment is db2 v7.2. Can I use db2jcc.jar to connect to db2 v7.2? Thanks a lot. Chih-Fei.
0
by: jazz1 | last post by:
my coding is <% //Connection conn=null; //Statement st=null; //ResultSet rs=null; int msgCount; try { String userid=request.getParameter("application_no");
2
by: Zunil | last post by:
Hi All, We are testing one of our component with JDBC + DB2 using db2jcc driver. We afced a strange issue. Scenario is like this. 1. We insert 1 record to a table having IDENTITY column as the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.