473,385 Members | 1,869 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,385 software developers and data experts.

JDBC Type 4 Universal Driver SQL Error Code = -99999

2
We have a JAVA application which uses following
Database product name : DB2
Database product version : DSN07012
JDBC driver name : IBM DB2 JDBC Universal Driver Architecture
JDBC driver version : 2.3.63
APplication Server:Websphere

When the prepared statement cache for the JDBC driver is set to > 0 following query fails on DB2 OS/390 version but doesn't fail on the UDB version on Windows. Any ideas.

Error:
: SQL Error Code = -99999 : MESSAGE = PreparedStatement: setNull method setting a non-nullable input parameter 1 to null.

Query is a : SELECT COUNTY FROM SYS_COUNTY where STATE_PROV_ID = ?

the parameter meter "?" is a state Id which happens to be passed in as "null" at runtime and which is being set using setBigDecimal() call to the prepared statement. STATE_PROV_ID in SYS_COUNTY table is defined as a NUMERIC(15), NOT NULL column. The error message makes perfectly sense but the problem is that we have no way to find all the places where the parameters values are nulls at runtime and fix the code.

Is this bug in driver or bug in our code? It appears that IBM remove same limitation from SQLJ from JDBC 2.3.72 version but they didn't specify anything for JDBC , Type 4 access.

Any Ideas?

- Anil
Mar 1 '06 #1
1 13188
sbanil
2
If anybody cares==> Here is the reply from IBM on the behaviour. They confirmed that this validation is removed from Unversal Driver version 2.3.73.

"The problem here is the describe information returned from the server for the input parameters. The describe information returned from different servers is different that's why you see different results. Here is what I am seeing with regard to different servers.

For example sql statement "select * from table where col1 = ?" where col1 is defined as char(10) not null.

The describe information returned regarding the nullability of the input column (i.e col1) for

v7ZOs : Nullability of col1 is returned as false that is correct since the col1 is defined as not null.
v8 zOs : Nullability of col1 is returned as true that is incorrect.
v8 UDB: Nullability of col1 is returned as true that is incorrect.

Universal JDBC driver prior to 2.3.73 version were comparing the nullability returned in the describe information to the value passed in setXXX() method. So in the case of v7 zOS the nullability returned from the server says that the column can't be null whereas the application was passing it as null so you get the error customer is getting.

I also want to make a comment on the prepared statement cache behavior that you are seeing with zOs server. The reason is that when prepared statement cache is set to zero the prepared statement does not request the describe information so it does not check the nullability of the value set in the setXXX() method.

Now let me answer your questions based on the above information

1. The fix for setNull is also applicable for both Type and Type 4.

3. It works for zOS databases because of the above reason.

Hope this will help understand why you are seeing weird behavior."

I then responded and asked:

"So, what you are saying is that if they switch to the version 2.3.73 driver, they will not see the error with v7 ZOS anymore? Is v8 ZOS and UDB behavior going to be "fixed" with regards to:
v7ZOs : Nullability of col1 is returned as false that is correct since the col1 is defined as not null.
v8 zOs : Nullability of col1 is returned as true that is incorrect.
v8 UDB: Nullability of col1 is returned as true that is incorrect."

And they responded with:

"Yes the problem should go away if they switch to 2.3.73 against v7 zOs. The fix was to remove the nullability check in the driver and let the server decide whether it liked the null value for that column. So with this fix the driver will behave the same against all the servers and will not depend on faulty describe information sent by the server. Its up to the server team to decide if they are ever going to fix this problem. But for now the driver side fix will take care of the server side problem."

Please let me know if you have any additional questions, or if I can close this PMR.
Mar 3 '06 #2

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

Similar topics

2
by: Paul Reddin | last post by:
Hi, (V8.1 Fp2) Our application uses JDBC batch to execute mutiple insert statements and we saw a strange thing this morning. There were 4 SQL Insert statements in the batch, and we know the...
3
by: Steverino | last post by:
Hi, I'm currently trying to learn DB2. I have the following version below installed on my server machine on my little LAN. However when I try to connect to it from my client machine, I receive...
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...
0
by: Bing | last post by:
Hi, I am configuring the same DB2 v8.1 JDBC universal driver (db2jcc.jar and db2jcc_license_cisuz.jar) from DB2 SP5 fix pack under WSAD 5.1.x environment and WebSphere application Server 5.0.2...
2
by: Raquel | last post by:
Read this about the Universal JDBC Driver.... "In a Type 2 mode, the Universal JDBC driver provides local application performance gains (because it avoids using TCP/IP protocol to communicate to...
2
by: charl | last post by:
Hi, My apologies in advance if my terminology is slightly confused, I am new to all this. We have previously been running some SQL on DB2 (v7) utilising a type 3 driver, and have made the...
3
by: kavallin | last post by:
I wonder if anyone has compared the db2 universal jdbc driver type 2 and 4 with the legacy db2 driver. Which one is the best to use ? I'm working in a project where the envm looks like this ...
3
by: %NAME% | last post by:
When using embedded SQL for db2 under solaris, you do not need to give username and password since the system will use your unix-login as default credential. However, with JDBC seems I always need...
2
by: %NAME% | last post by:
(Thanks to Bernd, Ian, Phil last time for their detailed answers last time) Now I try to call JDBC driver without giving the username and password as they suggested. I am using DB2 jdbc on SunOS...
3
by: Anoop | last post by:
Is it true that there are no type 4 jdbc drivers to connect to a DB2 server v7.1? The DB2 server is hosted on ACF2 (OS/390). We would be connecting from windows and solaris boxes. If it is true,...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.