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.
> 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);}}}}
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...