473,325 Members | 2,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

jdbc username and password follow-up

(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
2 5928
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
%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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Maxim | last post by:
Hi all! My problem is very, very silly and stupid, I know, don't blame me for that please... When I call my query from SQL*Plus, I get the correct result: SELECT check_passwd('user',...
2
by: Marc Stiegele | last post by:
Hello, I have a problem with the IBM DB2 UDB XML Extender. I`m working on a iSeries 400 server (AS/400, V5R1) with a integrated DB2 (my client is NT 4.0 Service Pack 1 with JDK1.1.8). I want to...
3
by: r_stringer66 | last post by:
Hi, I am trying to connect to a db2 database via a jdbc application and this is the following error I get: Exception : CLI0615E Error receiving from socket, server is not responding....
2
by: Phil Campaigne | last post by:
Hi All, I am seting up my web app with a tomcat/postgresql hosting service. From my psql client I type psql and then I am asked for my password. This logs me into my hosted database just fine. ...
1
by: nielsgron | last post by:
Hi, I am using the DB2 Type 4 JDBC Driver to connect to my DB2 8.2 for Windows server. Everything works perfectly unless I have a password with the pipe character ( "|" ) in it. The server...
3
by: %NAME% | last post by:
When using embedded SQL for db2 under solaris, you do not need to give username and password since the system will use your unix-login as default credential. However, with JDBC seems I always need...
2
by: Broke | last post by:
hi, I have problem with connecting my application with the database. Im using oracle and i populated the database using user account. However when i run the application i got this error: ORA-01017:...
1
by: aj | last post by:
I'm a newbie w/ SQL Server 2005. We will be connecting to SQL Server 2005 via JDBC. We have made this work by using an SQL Server account, rather than an Active Directory (AD) account, even...
0
by: caesarkim | last post by:
I need to connect to the db (created with "IBM-943" codeset) on DB2 AIX . I am having a problem retrieving data with japanese character in 'where' clause something like this. SELECT * FROM...
1
by: Debabrata Jana | last post by:
Please go through the JAVA code below: class Main{ public Connection getConnection(){ Connection l_con = null; try { String hostname = "172.10.23.1:1527"; //Host...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.