By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,610 Members | 1,697 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,610 IT Pros & Developers. It's quick & easy.

jdbc username and password follow-up

P: n/a
(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 5.8 with db2 version 7.2.0. When I am using the
type2 network driver (COM.ibm.db2.jdbc.net.DB2Driver) with username
and password, everything is fine.

However, when I use the application driver:
(COM.ibm.db2.jdbc.app.DB2Driver), and call
"DriverManger.getConnection(String url)" I get the following:

java.sql.SQLException: java.lang.UnsatisfiedLinkError: /fsys/.software/
local/db2-7.2/distribution/V7.1/lib/libdb2jdbc.so: Can't load Sparc 32-
bit .so on a Sparc v9 64-bit platform
at COM.ibm.db2.jdbc.app.DB2Driver.<init>(DB2Driver.ja va:240)
at
sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:
39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:
27)
at java.lang.reflect.Constructor.newInstance(Construc tor.java:
494)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303)
at SQL.main(SQL.java:90)
I guess this is because I do not have type2 application driver
installed properly? Since I
am not administrator, I switch to use the universal driver
(com.ibm.db2.jcc.DB2Driver), and
call the Type2 protocal again (without giving the server address,
port number, username/password), I get the following error:

com.ibm.db2.jcc.c.SqlException: Failure in loading T2 native library
db2jcct2
at com.ibm.db2.jcc.t2.a.a(a.java:31)
at
com.ibm.db2.jcc.t2.T2Configuration.<clinit>(T2Conf iguration.java:70)
at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:1 78)
at java.sql.DriverManager.getConnection(DriverManager .java:
525)
at java.sql.DriverManager.getConnection(DriverManager .java:
193)
at SQL.main(SQL.java:95)
I am wondering how could I install the minimal db2 client on my side
to make it work. Thanks a bunch!

Mar 31 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Mar 31, 4:28 pm, "%NAME%" <huaxinzh...@gmail.comwrote:
(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 5.8 with db2 version 7.2.0. When I am using the
type2 network driver (COM.ibm.db2.jdbc.net.DB2Driver) with username
and password, everything is fine.

However, when I use the application driver:
(COM.ibm.db2.jdbc.app.DB2Driver), and call
"DriverManger.getConnection(String url)" I get the following:

java.sql.SQLException: java.lang.UnsatisfiedLinkError: /fsys/.software/
local/db2-7.2/distribution/V7.1/lib/libdb2jdbc.so: Can't load Sparc 32-
bit .so on a Sparc v9 64-bit platform
at COM.ibm.db2.jdbc.app.DB2Driver.<init>(DB2Driver.ja va:240)
at
sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAcce*ssorImpl.java:
39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstru*ctorAccessorImpl.java:
27)
at java.lang.reflect.Constructor.newInstance(Construc tor.java:
494)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303)
at SQL.main(SQL.java:90)

I guess this is because I do not have type2 application driver
installed properly? Since I
am not administrator, I switch to use the universal driver
(com.ibm.db2.jcc.DB2Driver), and
call the Type2 protocal again (without giving the server address,
port number, username/password), I get the following error:

com.ibm.db2.jcc.c.SqlException: Failure in loading T2 native library
db2jcct2
at com.ibm.db2.jcc.t2.a.a(a.java:31)
at
com.ibm.db2.jcc.t2.T2Configuration.<clinit>(T2Conf iguration.java:70)
at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:1 78)
at java.sql.DriverManager.getConnection(DriverManager .java:
525)
at java.sql.DriverManager.getConnection(DriverManager .java:
193)
at SQL.main(SQL.java:95)

I am wondering how could I install the minimal db2 client on my side
to make it work. Thanks a bunch!
I'm guessing you're trying to access a 64-bit DB2 database using a 32-
bit JDK. In this situation, you need to create a 32-bit DB2 instance
and catalog a remote reference to your 64-bit DB2 database using a
database alias. You then need to connect to the database alias from
your Java program.

Mar 31 '07 #2

P: n/a
%NAME% wrote:

Just for clarification:
Now I try to call JDBC driver without giving the username and
password as they suggested. I am using DB2 jdbc on SunOS 5.8 with db2
version 7.2.0. When I am using the type2 network driver
(COM.ibm.db2.jdbc.net.DB2Driver) with username and password,
everything is fine.
The "net" Driver doesn't contain any native calls to the database,
everything is done by TCP/IP connects. So it doesn't know about users,
passwords, databases and so on by itself.
However, when I use the application driver:
(COM.ibm.db2.jdbc.app.DB2Driver),
The "app" Driver has native calls to an underlying, native library named
"libdb2jdbc.so" for Unix, "libdb2jdbc.sl" for HP, db2jdbc for OS2 and
db2jms for Windows (at least for v7). The native library can grab DB2
username and password and connection settings from the locally installed
DB2 client and you may do special stuff (like maintenance) with this
driver - as far as I can remember, played with this driver about 6 years
ago.
java.sql.SQLException: java.lang.UnsatisfiedLinkError: /fsys/.software/
local/db2-7.2/distribution/V7.1/lib/libdb2jdbc.so: Can't load Sparc 32-
bit .so on a Sparc v9 64-bit platform
Sounds like you need a "libdb2jdbc.so" compiled for 64bit. Maybe there
is something wrong with the fixpacks installed because it tries to load
it from /v7.1/lib. Maybe the library path is set wrong (I don't know
Unix so much).
I guess this is because I do not have type2 application driver
installed properly? Since I am not administrator, I switch to use the
universal driver (com.ibm.db2.jcc.DB2Driver), and call the Type2
protocal again (without giving the server address, port number,
username/password), I get the following error:
com.ibm.db2.jcc.c.SqlException: Failure in loading T2 native library
db2jcct2
Under OS/2 and Windows there was a tool named "db2cca" (client
configuration). Is there everything setup right? The "universal driver"
is unknown to me unfortunately.

Bernd

--
Well, there's egg and bacon; egg sausage and bacon; egg and
tr**********@spamonly.de; egg bacon and spam; egg bacon sausage
and tr**********@spamonly.net; spam bacon sausage and spam; spam
egg spam spam bacon and tr**********@nixwill.de ; spam sausage
Mar 31 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.