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

JDBC Type 4 Universal Driver SQL Error Code = -99999

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.

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


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 13173
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

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...
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...
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...
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...
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...
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...
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 ...
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...
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...
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,...
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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...

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.