If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Code works on one box but fails on another

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-30-10, 20:19
ssharma@bjs.com ssharma@bjs.com is offline
Registered User
 
Join Date: Jun 2010
Posts: 2
Code works on one box but fails on another

Greetings
I have two AIX boxes with the same locales and system charmap ISO8859-1. One houses WAS and the other houses DB2 database.
The DB2 codepage is 1208 and codeset is UTF-8.

I run a standalone Java program on the box that houses WAS. The Java application connects to the database on the other box, processes a bunch of xml files and persists in the database (as raw data, not xml). It does it successfully.
The JRE is
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build pap32dev-20091106a (SR11 ))
IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 AIX ppc-32 j9vmap3223-20091104 (JIT enabled)
J9VM - 20091103_45935_bHdSMr
JIT - 20091016_1845_r8
GC - 20091026_AA)
JCL - 20091106


Now I run the same Java program using the same JDBC driver against the same set of xml files on the box that houses the database but it fails with the following exception
COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver] CLI0109E String data right truncation. SQLSTATE=22001

The JRE on this box is slightly older even though it is of the same major level.
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build pap64dev-20070511(SR5))
IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 AIX ppc64-64 j9vmap6423-20070426 (JIT enabled)
J9VM - 20070420_12448_BHdSMr
JIT - 20070419_1806_r8
GC - 200704_19)
JCL - 20070511


Could it be the older JRE or is this something to do with character encoding or..? All assistance will be greatly appreciated.
Thanks
Sid
Reply With Quote
  #2 (permalink)  
Old 07-01-10, 07:31
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
I suspect that you are using the type 2 ("app") JDBC driver, which is deprecated. Use the type 4 ("jcc") driver instead.
Reply With Quote
  #3 (permalink)  
Old 07-01-10, 07:57
ssharma@bjs.com ssharma@bjs.com is offline
Registered User
 
Join Date: Jun 2010
Posts: 2
I am using the same driver on both machines. One works and the other does not.
I have also tried the jcc driver earlier. The error message was slightly different but it meant the same thing.
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

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