Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / March 2007

Tip: Looking for answers? Try searching our database.

jdbc username and password follow-up

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
%NAME% - 31 Mar 2007 16:28 GMT
(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.java:240)
       at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:
39)
       at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:
27)
       at java.lang.reflect.Constructor.newInstance(Constructor.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>(T2Configuration.java:70)
       at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:178)
       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!
james_dey@hotmail.com - 31 Mar 2007 16:32 GMT
> (Thanks to Bernd, Ian, Phil last time for their detailed answers last
> time)  Now I try to call JDBC driver
[quoted text clipped - 46 lines]
> 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.
Bernd Hohmann - 31 Mar 2007 17:56 GMT
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
[quoted text clipped - 3 lines]
> 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

Signature

Well, there's egg and bacon; egg sausage and bacon; egg and
trap20070330@spamonly.de; egg bacon and spam; egg bacon sausage
and trap20070330@spamonly.net; spam bacon sausage and spam; spam
egg spam spam bacon and trap20070330@nixwill.de ; spam sausage

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.