Question on java/jdbc feature in DB2 on OS/390

Tina Hilton

Question on java/jdbc feature in DB2 on OS/390
Can someone tell me when the code for JAVA/JDBC (fmid JDB6612) is used? Is
it only used when you have java code that is executed on OS/390, or is it
also invoked when you have a java app that executes on the PC and gets data
from DB2 via DB2 Connect?

We have a problem in a Windows java application where a "select into" (using
sqlj) gets a sqlcode 0 instead of +100 when the row doesn't exist. An
exception is thrown and the sqlstate is 02000 as it should be in this case.
There's a hit in IBMLink re: PQ44115, but we have the PTF on for this.
There's also a problem with an update that should get a +100, but doesn't
(no exception is thrown in this case). I've opened a problem with IBM, but
thought someone on the list might be able to give me an idea where to look
for the problem while I'm waiting to hear back from IBM. This is DB2 6.1
and DB2 Connect 7.2 (Fixpak 3).

Thanks.

Tina Hilton
Random House Bertelsmann Shared Services



---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". If you will be out of the office, send the SET DB2-L NOMAIL command to [login to unmask email] The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Rich Gugel

Re: Question on java/jdbc feature in DB2 on OS/390
(in response to Tina Hilton)
have you looked at your patch1 settings?

1024 Returns SQL_SUCCESS instead of SQL_NO_DATA_FOUND from the
SQLExecute() and SQLExecDirect() functions if the executed UPDATE or DELETE
statement affected no rows. This value may be needed by some Microsoft
Visual Basic applications.

-----Original Message-----
From: [login to unmask email] [mailto:[login to unmask email]
Sent: Tuesday, January 06, 2004 12:17 PM
To: [login to unmask email]
Subject: Question on java/jdbc feature in DB2 on OS/390



Can someone tell me when the code for JAVA/JDBC (fmid JDB6612) is used? Is
it only used when you have java code that is executed on OS/390, or is it
also invoked when you have a java app that executes on the PC and gets data
from DB2 via DB2 Connect?

We have a problem in a Windows java application where a "select into" (using
sqlj) gets a sqlcode 0 instead of +100 when the row doesn't exist. An
exception is thrown and the sqlstate is 02000 as it should be in this case.
There's a hit in IBMLink re: PQ44115, but we have the PTF on for this.
There's also a problem with an update that should get a +100, but doesn't
(no exception is thrown in this case). I've opened a problem with IBM, but
thought someone on the list might be able to give me an idea where to look
for the problem while I'm waiting to hear back from IBM. This is DB2 6.1
and DB2 Connect 7.2 (Fixpak 3).

Thanks.

Tina Hilton
Random House Bertelsmann Shared Services


----------------------------------------------------------------------------
----- Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and
home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page
select "Join or Leave the list". If you will be out of the office, send the
SET DB2-L NOMAIL command to [login to unmask email] The IDUG List Admins
can be reached at [login to unmask email] Find out the latest on
IDUG conferences at http://conferences.idug.org/index.cfm


---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". If you will be out of the office, send the SET DB2-L NOMAIL command to [login to unmask email] The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Myron Miller

Re: Question on java/jdbc feature in DB2 on OS/390
(in response to Rich Gugel)
As far as I know, the code for JAVA/JDBC is only executed when you have JAVA
code that runs directly on the mainframe. At least that's the way it is in my
clients. We run lots of JAVA apps from servers, both windows and AIX that use
DB2 connect to access data on the mainframe.

Personally, I'd upgrade your DB2 connect to at least FP6, if not FP10a. I've
found a number of JAVA problems and JDBC issues with FP3 that are resolved in
FP6. I don't remembe all of them at this time. Also, FP6 is required (at
least fp5) to support JDK 1.3 and JDBC 2.0. And this works much better with
JAVA.

Myron
--- [login to unmask email] wrote:
> Can someone tell me when the code for JAVA/JDBC (fmid JDB6612) is used? Is
> it only used when you have java code that is executed on OS/390, or is it
> also invoked when you have a java app that executes on the PC and gets data
> from DB2 via DB2 Connect?
>
> We have a problem in a Windows java application where a "select into" (using
> sqlj) gets a sqlcode 0 instead of +100 when the row doesn't exist. An
> exception is thrown and the sqlstate is 02000 as it should be in this case.
> There's a hit in IBMLink re: PQ44115, but we have the PTF on for this.
> There's also a problem with an update that should get a +100, but doesn't
> (no exception is thrown in this case). I've opened a problem with IBM, but
> thought someone on the list might be able to give me an idea where to look
> for the problem while I'm waiting to hear back from IBM. This is DB2 6.1
> and DB2 Connect 7.2 (Fixpak 3).
>
> Thanks.
>
> Tina Hilton
> Random House Bertelsmann Shared Services
>
>
>
>
---------------------------------------------------------------------------------
> Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home
> page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select
> "Join or Leave the list". If you will be out of the office, send the SET
> DB2-L NOMAIL command to [login to unmask email] The IDUG List Admins can
> be reached at [login to unmask email] Find out the latest on IDUG
> conferences at http://conferences.idug.org/index.cfm
>


__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". If you will be out of the office, send the SET DB2-L NOMAIL command to [login to unmask email] The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Tina Hilton

Re: Question on java/jdbc feature in DB2 on OS/390
(in response to Myron Miller)
Showing my ignorance probably, but what are patch1 settings and where do I
set them?

-----Original Message-----
From: Gugel, Rich [mailto:[login to unmask email]
Sent: Tuesday, January 06, 2004 3:51 PM
To: [login to unmask email]
Subject: Re: Question on java/jdbc feature in DB2 on OS/390


have you looked at your patch1 settings?


1024 Returns SQL_SUCCESS instead of SQL_NO_DATA_FOUND from the
SQLExecute() and SQLExecDirect() functions if the executed UPDATE or DELETE
statement affected no rows. This value may be needed by some Microsoft
Visual Basic applications.

-----Original Message-----
From: [login to unmask email] [mailto:[login to unmask email]
Sent: Tuesday, January 06, 2004 12:17 PM
To: [login to unmask email]
Subject: Question on java/jdbc feature in DB2 on OS/390



Can someone tell me when the code for JAVA/JDBC (fmid JDB6612) is used? Is
it only used when you have java code that is executed on OS/390, or is it
also invoked when you have a java app that executes on the PC and gets data
from DB2 via DB2 Connect?

We have a problem in a Windows java application where a "select into" (using
sqlj) gets a sqlcode 0 instead of +100 when the row doesn't exist. An
exception is thrown and the sqlstate is 02000 as it should be in this case.
There's a hit in IBMLink re: PQ44115, but we have the PTF on for this.
There's also a problem with an update that should get a +100, but doesn't
(no exception is thrown in this case). I've opened a problem with IBM, but
thought someone on the list might be able to give me an idea where to look
for the problem while I'm waiting to hear back from IBM. This is DB2 6.1
and DB2 Connect 7.2 (Fixpak 3).

Thanks.

Tina Hilton
Random House Bertelsmann Shared Services


----------------------------------------------------------------------------
----- Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and
home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page
select "Join or Leave the list". If you will be out of the office, send the
SET DB2-L NOMAIL command to [login to unmask email] The IDUG List Admins
can be reached at [login to unmask email] Find out the latest on
IDUG conferences at http://conferences.idug.org/index.cfm

----------------------------------------------------------------------------
----- Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and
home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page
select "Join or Leave the list". If you will be out of the office, send the
SET DB2-L NOMAIL command to [login to unmask email] The IDUG List Admins
can be reached at [login to unmask email] Find out the latest on
IDUG conferences at http://conferences.idug.org/index.cfm


---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". If you will be out of the office, send the SET DB2-L NOMAIL command to [login to unmask email] The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Tina Hilton

Re: Question on java/jdbc feature in DB2 on OS/390
(in response to Tina Hilton)
We're in the process of upgrading our DB2 Connect server and then will do
the clients. I was hoping that wouldn't be required to fix the problem
since they want this application to move into production a week from Friday.
I do plan on upgrading the client on my laptop and testing it to see if it
takes care of the problem.

Thanks.

-----Original Message-----
From: Myron Miller [mailto:[login to unmask email]
Sent: Tuesday, January 06, 2004 5:23 PM
To: [login to unmask email]
Subject: Re: Question on java/jdbc feature in DB2 on OS/390


As far as I know, the code for JAVA/JDBC is only executed when you have JAVA
code that runs directly on the mainframe. At least that's the way it is in
my clients. We run lots of JAVA apps from servers, both windows and AIX
that use DB2 connect to access data on the mainframe.

Personally, I'd upgrade your DB2 connect to at least FP6, if not FP10a.
I've found a number of JAVA problems and JDBC issues with FP3 that are
resolved in FP6. I don't remembe all of them at this time. Also, FP6 is
required (at least fp5) to support JDK 1.3 and JDBC 2.0. And this works
much better with JAVA.

Myron
--- [login to unmask email] wrote:
> Can someone tell me when the code for JAVA/JDBC (fmid JDB6612) is
> used? Is it only used when you have java code that is executed on
> OS/390, or is it also invoked when you have a java app that executes
> on the PC and gets data from DB2 via DB2 Connect?
>
> We have a problem in a Windows java application where a "select into"
> (using
> sqlj) gets a sqlcode 0 instead of +100 when the row doesn't exist. An
> exception is thrown and the sqlstate is 02000 as it should be in this
case.
> There's a hit in IBMLink re: PQ44115, but we have the PTF on for this.
> There's also a problem with an update that should get a +100, but doesn't
> (no exception is thrown in this case). I've opened a problem with IBM,
but
> thought someone on the list might be able to give me an idea where to look
> for the problem while I'm waiting to hear back from IBM. This is DB2 6.1
> and DB2 Connect 7.2 (Fixpak 3).
>
> Thanks.
>
> Tina Hilton
> Random House Bertelsmann Shared Services
>
>
>
>
----------------------------------------------------------------------------
-----
> Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and
> home page at http://www.idugdb2-l.org/archives/db2-l.html. From that
> page select "Join or Leave the list". If you will be out of the
> office, send the SET DB2-L NOMAIL command to
> [login to unmask email] The IDUG List Admins can be reached at
> [login to unmask email] Find out the latest on IDUG
> conferences at http://conferences.idug.org/index.cfm
>


__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus

----------------------------------------------------------------------------
-----
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home
page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select
"Join or Leave the list". If you will be out of the office, send the SET
DB2-L NOMAIL command to [login to unmask email] The IDUG List Admins can
be reached at [login to unmask email] Find out the latest on IDUG
conferences at http://conferences.idug.org/index.cfm

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". If you will be out of the office, send the SET DB2-L NOMAIL command to [login to unmask email] The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Rich Gugel

Re: Question on java/jdbc feature in DB2 on OS/390
(in response to Tina Hilton)
The patch settings can be viewed by looking at the db2cli.ini file. It's a
longshot, but worth checking out

Many of our distributed java problems were also fixed by connect fp6

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". If you will be out of the office, send the SET DB2-L NOMAIL command to [login to unmask email] The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Alex Pauliah

Re: Question on java/jdbc feature in DB2 on OS/390
(in response to Rich Gugel)
Tina,

The settings are located in db2cli.ini in the SQLLIB directory

Alex J. Pauliah
DB2 DBA
TXU Database Technology
W: (214) 486 6784
P: (214) 314 5973



[login to unmask email]
SYSTEMS.COM To: [login to unmask email]
Sent by: DB2 Data cc:
Base Discussion Subject: Re: Question on java/jdbc feature in DB2 on OS/390
List
<[login to unmask email]
RG>


01/07/2004 07:30
AM
Please respond to
DB2 Database
Discussion list at
IDUG






Showing my ignorance probably, but what are patch1 settings and where do I
set them?
-----Original Message-----
From: Gugel, Rich [mailto:[login to unmask email]
Sent: Tuesday, January 06, 2004 3:51 PM
To: [login to unmask email]
Subject: Re: Question on java/jdbc feature in DB2 on OS/390

have you looked at your patch1 settings?

|---+---------------------------------------------------------------------|
| 10| Returns SQL_SUCCESS instead of SQL_NO_DATA_FOUND from the SQLExecute|
| 24| () and SQLExecDirect() functions if the executed UPDATE or DELETE |
| | statement affected no rows. This value may be needed by some |
| | Microsoft Visual Basic applications. |
|---+---------------------------------------------------------------------|

-----Original Message-----
From: [login to unmask email]
[mailto:[login to unmask email]
Sent: Tuesday, January 06, 2004 12:17 PM
To: [login to unmask email]
Subject: Question on java/jdbc feature in DB2 on OS/390



Can someone tell me when the code for JAVA/JDBC (fmid JDB6612)
is used? Is it only used when you have java code that is
executed on OS/390, or is it also invoked when you have a java
app that executes on the PC and gets data from DB2 via DB2
Connect?


We have a problem in a Windows java application where a "select
into" (using sqlj) gets a sqlcode 0 instead of +100 when the
row doesn't exist. An exception is thrown and the sqlstate is
02000 as it should be in this case. There's a hit in IBMLink
re: PQ44115, but we have the PTF on for this. There's also a
problem with an update that should get a +100, but doesn't (no
exception is thrown in this case). I've opened a problem with
IBM, but thought someone on the list might be able to give me
an idea where to look for the problem while I'm waiting to hear
back from IBM. This is DB2 6.1 and DB2 Connect 7.2 (Fixpak 3).


Thanks.


Tina Hilton
Random House Bertelsmann Shared Services



---------------------------------------------------------------------------------

Welcome to the IDUG DB2-L list. To unsubscribe, go to the
archives and home page at
http://www.idugdb2-l.org/archives/db2-l.html. From that page
select "Join or Leave the list". If you will be out of the
office, send the SET DB2-L NOMAIL command to
[login to unmask email] The IDUG List Admins can be reached
at [login to unmask email] Find out the latest on IDUG
conferences at http://conferences.idug.org/index.cfm
---------------------------------------------------------------------------------

Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives
and home page at http://www.idugdb2-l.org/archives/db2-l.html. From
that page select "Join or Leave the list". If you will be out of the
office, send the SET DB2-L NOMAIL command to
[login to unmask email] The IDUG List Admins can be reached at
[login to unmask email] Find out the latest on IDUG
conferences at http://conferences.idug.org/index.cfm
---------------------------------------------------------------------------------

Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home
page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select
"Join or Leave the list". If you will be out of the office, send the SET
DB2-L NOMAIL command to [login to unmask email] The IDUG List Admins
can be reached at [login to unmask email] Find out the latest on
IDUG conferences at http://conferences.idug.org/index.cfm






*********************************************************************************
Confidentiality Notice: This email message, including any attachments,
contains or may contain confidential information intended only for the
addressee. If you are not an intended recipient of this message, be
advised that any reading, dissemination, forwarding, printing, copying
or other use of this message or its attachments is strictly prohibited. If
you have received this message in error, please notify the sender
immediately by reply message and delete this email message and any
attachments from your system.
*********************************************************************************

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". If you will be out of the office, send the SET DB2-L NOMAIL command to [login to unmask email] The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Tina Hilton

Re: Question on java/jdbc feature in DB2 on OS/390
(in response to Alex Pauliah)
The select problem is fixed by upgrading the DB2 Connect client to Fixpak
10a. However, the update is still not working. Here's the source code:

FirstName = "Scott";
LastName = "Kreiger";
EmployeeNumber = "OOPS";
#sql {UPDATE DSN8610.NEWPHONE
SET FIRSTNAME = :FirstName
,LASTNAME = :LastName
WHERE EMPLOYEENUMBER = :EmployeeNumber
}; /* End of SQL */
System.out.println("\n!!!" + rightNow() + " Done with Bad Update... I
should not see this!");
}catch(SQLException e){
System.out.println("\n%%% SQLException on UPDATE %%%");
System.out.println(" ErrorCode=" + e.getErrorCode());
System.out.println(" SQLState =" + e.getSQLState());
System.out.println(" NextException =" + e.getNextException());
}catch(Exception e){
System.out.println("\n%%% Exception on Update %%%");
System.out.println("Excption info: \n" + e);
} // End of Update

The error messages are not displayed, so it doesn't seem to be catching the
error. When I turn the trace on, though, it displays the appropriate
SQLCODE and SQLSTATE. Does this make sense to anyone? Here's the trace
output:

| | | SQLExceptionGenerator -> addWarning(DB2Statement) (2004-1-8
15:32:43.960)
| | | | SQLState = 02000
| | | | SQLmessage = [IBM][CLI Driver][DB2] SQL0100W No row was found for
FETCH, UPDATE or DELETE; or the result of a query is an empty table.
SQLSTATE=02000

| | | | SQLnativeCode = 100
| | | SQLExceptionGenerator <- addWarning(DB2Statement)
| | | jdbc.app.DB2Warning -> DB2Warning() (2004-1-8 15:32:43.970)
| | | | 10: SQLError = [IBM][CLI Driver][DB2] SQL0100W No row was found for
FETCH, UPDATE or DELETE; or the result of a query is an empty table.
SQLSTATE=02000

| | | | SQLState = 02000
| | | | SQLNativeCode = 100
| | | | LineNumber = 0
| | | | SQLerrmc =

-----Original Message-----
From: [login to unmask email] [mailto:[login to unmask email]
Sent: Tuesday, January 06, 2004 1:17 PM
To: [login to unmask email]
Subject: Question on java/jdbc feature in DB2 on OS/390



Can someone tell me when the code for JAVA/JDBC (fmid JDB6612) is used? Is
it only used when you have java code that is executed on OS/390, or is it
also invoked when you have a java app that executes on the PC and gets data
from DB2 via DB2 Connect?

We have a problem in a Windows java application where a "select into" (using
sqlj) gets a sqlcode 0 instead of +100 when the row doesn't exist. An
exception is thrown and the sqlstate is 02000 as it should be in this case.
There's a hit in IBMLink re: PQ44115, but we have the PTF on for this.
There's also a problem with an update that should get a +100, but doesn't
(no exception is thrown in this case). I've opened a problem with IBM, but
thought someone on the list might be able to give me an idea where to look
for the problem while I'm waiting to hear back from IBM. This is DB2 6.1
and DB2 Connect 7.2 (Fixpak 3).

Thanks.

Tina Hilton
Random House Bertelsmann Shared Services


----------------------------------------------------------------------------
----- Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and
home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page
select "Join or Leave the list". If you will be out of the office, send the
SET DB2-L NOMAIL command to [login to unmask email] The IDUG List Admins
can be reached at [login to unmask email] Find out the latest on
IDUG conferences at http://conferences.idug.org/index.cfm


---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". If you will be out of the office, send the SET DB2-L NOMAIL command to [login to unmask email] The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Rich Gugel

Re: Question on java/jdbc feature in DB2 on OS/390
(in response to Tina Hilton)
According to the documentation a sql code of +100 on an update does not
throw an exception. You may need to examine the sqlca. The version 7
Java Application Guide has new documentation samples added to show how to
check the sqlca and warnings. You may want to take a peek at it online.
Good Luck


"SQLJ clauses use the JDBC class java.sql.SQLException for error handling.
SQLJ generates an SQLException under the following
circumstances:

When any SQL statement returns a negative SQLCODE

When a SELECT INTO SQL statement returns a +100 SQLCODE"



-----Original Message-----
From: [login to unmask email] [mailto:[login to unmask email]
Sent: Thursday, January 08, 2004 3:05 PM
To: [login to unmask email]
Subject: Re: Question on java/jdbc feature in DB2 on OS/390


The select problem is fixed by upgrading the DB2 Connect client to Fixpak
10a. However, the update is still not working. Here's the source code:

FirstName = "Scott";
LastName = "Kreiger";
EmployeeNumber = "OOPS";
#sql {UPDATE DSN8610.NEWPHONE
SET FIRSTNAME = :FirstName
,LASTNAME = :LastName
WHERE EMPLOYEENUMBER = :EmployeeNumber
}; /* End of SQL */
System.out.println("\n!!!" + rightNow() + " Done with Bad Update... I
should not see this!");
}catch(SQLException e){
System.out.println("\n%%% SQLException on UPDATE %%%");
System.out.println(" ErrorCode=" + e.getErrorCode());
System.out.println(" SQLState =" + e.getSQLState());
System.out.println(" NextException =" + e.getNextException());
}catch(Exception e){
System.out.println("\n%%% Exception on Update %%%");
System.out.println("Excption info: \n" + e);
} // End of Update

The error messages are not displayed, so it doesn't seem to be catching the
error. When I turn the trace on, though, it displays the appropriate
SQLCODE and SQLSTATE. Does this make sense to anyone? Here's the trace
output:

| | | SQLExceptionGenerator -> addWarning(DB2Statement) (2004-1-8
15:32:43.960)
| | | | SQLState = 02000
| | | | SQLmessage = [IBM][CLI Driver][DB2] SQL0100W No row was found for
FETCH, UPDATE or DELETE; or the result of a query is an empty table.
SQLSTATE=02000

| | | | SQLnativeCode = 100
| | | SQLExceptionGenerator <- addWarning(DB2Statement)
| | | jdbc.app.DB2Warning -> DB2Warning() (2004-1-8 15:32:43.970)
| | | | 10: SQLError = [IBM][CLI Driver][DB2] SQL0100W No row was found for
FETCH, UPDATE or DELETE; or the result of a query is an empty table.
SQLSTATE=02000

| | | | SQLState = 02000
| | | | SQLNativeCode = 100
| | | | LineNumber = 0
| | | | SQLerrmc =

-----Original Message-----
From: [login to unmask email] [mailto:[login to unmask email]
Sent: Tuesday, January 06, 2004 1:17 PM
To: [login to unmask email]
Subject: Question on java/jdbc feature in DB2 on OS/390



Can someone tell me when the code for JAVA/JDBC (fmid JDB6612) is used? Is
it only used when you have java code that is executed on OS/390, or is it
also invoked when you have a java app that executes on the PC and gets data
from DB2 via DB2 Connect?

We have a problem in a Windows java application where a "select into" (using
sqlj) gets a sqlcode 0 instead of +100 when the row doesn't exist. An
exception is thrown and the sqlstate is 02000 as it should be in this case.
There's a hit in IBMLink re: PQ44115, but we have the PTF on for this.
There's also a problem with an update that should get a +100, but doesn't
(no exception is thrown in this case). I've opened a problem with IBM, but
thought someone on the list might be able to give me an idea where to look
for the problem while I'm waiting to hear back from IBM. This is DB2 6.1
and DB2 Connect 7.2 (Fixpak 3).

Thanks.

Tina Hilton
Random House Bertelsmann Shared Services


----------------------------------------------------------------------------
----- Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and
home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page
select "Join or Leave the list". If you will be out of the office, send the
SET DB2-L NOMAIL command to [login to unmask email] The IDUG List Admins
can be reached at [login to unmask email] Find out the latest on
IDUG conferences at http://conferences.idug.org/index.cfm

----------------------------------------------------------------------------
----- Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and
home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page
select "Join or Leave the list". If you will be out of the office, send the
SET DB2-L NOMAIL command to [login to unmask email] The IDUG List Admins
can be reached at [login to unmask email] Find out the latest on
IDUG conferences at http://conferences.idug.org/index.cfm


---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". If you will be out of the office, send the SET DB2-L NOMAIL command to [login to unmask email] The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Tina Hilton

Re: Question on java/jdbc feature in DB2 on OS/390
(in response to Rich Gugel)
Thank you Rich! We're new in this java stuff and apparently this is
something the programmers didn't realize was so different from mainframe
programming. Checking SQLWarning in addition to SQLException is the way to
go.

This group is great!

-----Original Message-----
From: Gugel, Rich [mailto:[login to unmask email]
Sent: Friday, January 09, 2004 8:06 AM
To: [login to unmask email]
Subject: Re: Question on java/jdbc feature in DB2 on OS/390


According to the documentation a sql code of +100 on an update does not
throw an exception. You may need to examine the sqlca. The version 7
Java Application Guide has new documentation samples added to show how to
check the sqlca and warnings. You may want to take a peek at it online.
Good Luck


"SQLJ clauses use the JDBC class java.sql.SQLException for error handling.
SQLJ generates an SQLException under the following
circumstances:

When any SQL statement returns a negative SQLCODE

When a SELECT INTO SQL statement returns a +100 SQLCODE"



-----Original Message-----
From: [login to unmask email] [mailto:[login to unmask email]
Sent: Thursday, January 08, 2004 3:05 PM
To: [login to unmask email]
Subject: Re: Question on java/jdbc feature in DB2 on OS/390


The select problem is fixed by upgrading the DB2 Connect client to Fixpak
10a. However, the update is still not working. Here's the source code:

FirstName = "Scott";
LastName = "Kreiger";
EmployeeNumber = "OOPS";
#sql {UPDATE DSN8610.NEWPHONE
SET FIRSTNAME = :FirstName
,LASTNAME = :LastName
WHERE EMPLOYEENUMBER = :EmployeeNumber
}; /* End of SQL */
System.out.println("\n!!!" + rightNow() + " Done with Bad Update... I
should not see this!");
}catch(SQLException e){
System.out.println("\n%%% SQLException on UPDATE %%%");
System.out.println(" ErrorCode=" + e.getErrorCode());
System.out.println(" SQLState =" + e.getSQLState());
System.out.println(" NextException =" + e.getNextException());
}catch(Exception e){
System.out.println("\n%%% Exception on Update %%%");
System.out.println("Excption info: \n" + e);
} // End of Update

The error messages are not displayed, so it doesn't seem to be catching the
error. When I turn the trace on, though, it displays the appropriate
SQLCODE and SQLSTATE. Does this make sense to anyone? Here's the trace
output:

| | | SQLExceptionGenerator -> addWarning(DB2Statement) (2004-1-8
15:32:43.960)
| | | | SQLState = 02000
| | | | SQLmessage = [IBM][CLI Driver][DB2] SQL0100W No row was found for
FETCH, UPDATE or DELETE; or the result of a query is an empty table.
SQLSTATE=02000

| | | | SQLnativeCode = 100
| | | SQLExceptionGenerator <- addWarning(DB2Statement)
| | | jdbc.app.DB2Warning -> DB2Warning() (2004-1-8 15:32:43.970)
| | | | 10: SQLError = [IBM][CLI Driver][DB2] SQL0100W No row was found for
FETCH, UPDATE or DELETE; or the result of a query is an empty table.
SQLSTATE=02000

| | | | SQLState = 02000
| | | | SQLNativeCode = 100
| | | | LineNumber = 0
| | | | SQLerrmc =

-----Original Message-----
From: [login to unmask email] [mailto:[login to unmask email]
Sent: Tuesday, January 06, 2004 1:17 PM
To: [login to unmask email]
Subject: Question on java/jdbc feature in DB2 on OS/390



Can someone tell me when the code for JAVA/JDBC (fmid JDB6612) is used? Is
it only used when you have java code that is executed on OS/390, or is it
also invoked when you have a java app that executes on the PC and gets data
from DB2 via DB2 Connect?

We have a problem in a Windows java application where a "select into" (using
sqlj) gets a sqlcode 0 instead of +100 when the row doesn't exist. An
exception is thrown and the sqlstate is 02000 as it should be in this case.
There's a hit in IBMLink re: PQ44115, but we have the PTF on for this.
There's also a problem with an update that should get a +100, but doesn't
(no exception is thrown in this case). I've opened a problem with IBM, but
thought someone on the list might be able to give me an idea where to look
for the problem while I'm waiting to hear back from IBM. This is DB2 6.1
and DB2 Connect 7.2 (Fixpak 3).

Thanks.

Tina Hilton
Random House Bertelsmann Shared Services


----------------------------------------------------------------------------
----- Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and
home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page
select "Join or Leave the list". If you will be out of the office, send the
SET DB2-L NOMAIL command to [login to unmask email] The IDUG List Admins
can be reached at [login to unmask email] Find out the latest on
IDUG conferences at http://conferences.idug.org/index.cfm

----------------------------------------------------------------------------
----- Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and
home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page
select "Join or Leave the list". If you will be out of the office, send the
SET DB2-L NOMAIL command to [login to unmask email] The IDUG List Admins
can be reached at [login to unmask email] Find out the latest on
IDUG conferences at http://conferences.idug.org/index.cfm

----------------------------------------------------------------------------
----- Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and
home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page
select "Join or Leave the list". If you will be out of the office, send the
SET DB2-L NOMAIL command to [login to unmask email] The IDUG List Admins
can be reached at [login to unmask email] Find out the latest on
IDUG conferences at http://conferences.idug.org/index.cfm


---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". If you will be out of the office, send the SET DB2-L NOMAIL command to [login to unmask email] The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm