Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Urgent: DB2 code page conversion error through JDBC connect

442 views
Skip to first unread message

Stephen

unread,
May 21, 2001, 10:35:55 PM5/21/01
to
I have installed a DB2 Workgroup edition server 7.1 in one machine
running
Windows 2000 Server and developing a java program running on a Windows
NT 4.0
machine with DB2 7.1 client installed.

The codepage for the server is set to 950 (traditional chinese big5).
And to avoid code page conversion, in the client, I use db2set to set
db2codepage to 950 also. And I found no problem for db connection
through db2 commandline (db2cmd).

However, when I use JDBC to connect (use native driver : COM.ibm.db2.j
dbc.app.DB2Driver), I get a SQL exception when using the DriverManager
.getConnection:
java.sql.SQLException: Code page conversion tables do not exist
at COM.ibm.db2.jdbc.app.DB2Connection.SQLConnect(Native Method)
at COM.ibm.db2.jdbc.app.DB2Connection.connect(DB2Connection.java,
Compiled
Code)
at COM.ibm.db2.jdbc.app.DB2Connection.<init>(DB2Connection.java:321)
at COM.ibm.db2.jdbc.app.DB2Driver.connect(DB2Driver.java:337)
at java.sql.DriverManager.getConnection(DriverManager.java:457)
at java.sql.DriverManager.getConnection(DriverManager.java:137)
at testDB.main(testDB.java:13)
Exception in thread "main"


It seems that the db2 jdbc driver does not read the db2set environment
variables...

I am sure the necessary classpath is set (like db2java.zip and
runtime.zip are
included).

How can I let DB2 know the client is also with codepage = 950 through
JDBC (since I don't want code page conversion. )

regards.

Stephen.

bernd hohmann

unread,
May 22, 2001, 7:56:28 AM5/22/01
to
On 21 May 2001 19:35:55 -0700, Stephen wrote:

> How can I let DB2 know the client is also with codepage = 950 through
> JDBC (since I don't want code page conversion. )

the client must be on the same codepage (chcp 950), as far i
understand the concept.

bernd

--
class Mandel{public static void main(String a[]){float b,e,r,n,d;int h;
for(e=1.1f;e>-1.2;e-=.1){for(b=-2;b<1;b+=.04){r=n=0;for(h=127;r*r+n*n<4
&&--h>32;){d=r;r=r*r-n*n+b;n=2*d*n+e;}System.out.write(b>0.98?10:h);}}}}

Sherman Lau

unread,
May 30, 2001, 8:29:39 AM5/30/01
to
Hi Stephen,

Code page conversion cannot be avoided in JDBC connection as JDBC is
using Unicode internally. All data need to be converted from Big5 to
Unicode
in your application.

The problem you experienced is missing conversion tables. If you check
sqllib\conv subdirectory, you probably do not have 0950ucs2.cnv and
ucs20950.cnv. There is an optional install for Asian Conversion Tables
in DB2 v7 installation disc. Or if you apply the latest fixpak, the
conversion
tables will be installed for you automatically.

Sherman
"Stephen" <ht...@usa.net> wrote in message
news:b82e7e12.01052...@posting.google.com...

0 new messages