473,734 Members | 2,693 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.jd bc.net.DB2Drive r) with username
and password, everything is fine.

However, when I use the application driver:
(COM.ibm.db2.jd bc.app.DB2Drive r), and call
"DriverManger.g etConnection(St ring url)" I get the following:

java.sql.SQLExc eption: java.lang.Unsat isfiedLinkError : /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.jdb c.app.DB2Driver .<init>(DB2Driv er.java:240)
at
sun.reflect.Nat iveConstructorA ccessorImpl.new Instance0(Nativ e Method)
at
sun.reflect.Nat iveConstructorA ccessorImpl.new Instance(Native ConstructorAcce ssorImpl.java:
39)
at
sun.reflect.Del egatingConstruc torAccessorImpl .newInstance(De legatingConstru ctorAccessorImp l.java:
27)
at java.lang.refle ct.Constructor. newInstance(Con structor.java:
494)
at java.lang.Class .newInstance0(C lass.java:350)
at java.lang.Class .newInstance(Cl ass.java:303)
at SQL.main(SQL.ja va: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.jc c.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.T2Configura tion.<clinit>(T 2Configuration. java:70)
at com.ibm.db2.jcc .DB2Driver.conn ect(DB2Driver.j ava:178)
at java.sql.Driver Manager.getConn ection(DriverMa nager.java:
525)
at java.sql.Driver Manager.getConn ection(DriverMa nager.java:
193)
at SQL.main(SQL.ja va: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 5966
On Mar 31, 4:28 pm, "%NAME%" <huaxinzh...@gm ail.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.jd bc.net.DB2Drive r) with username
and password, everything is fine.

However, when I use the application driver:
(COM.ibm.db2.jd bc.app.DB2Drive r), and call
"DriverManger.g etConnection(St ring url)" I get the following:

java.sql.SQLExc eption: java.lang.Unsat isfiedLinkError : /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.jdb c.app.DB2Driver .<init>(DB2Driv er.java:240)
at
sun.reflect.Nat iveConstructorA ccessorImpl.new Instance0(Nativ e Method)
at
sun.reflect.Nat iveConstructorA ccessorImpl.new Instance(Native ConstructorAcce *ssorImpl.java:
39)
at
sun.reflect.Del egatingConstruc torAccessorImpl .newInstance(De legatingConstru *ctorAccessorIm pl.java:
27)
at java.lang.refle ct.Constructor. newInstance(Con structor.java:
494)
at java.lang.Class .newInstance0(C lass.java:350)
at java.lang.Class .newInstance(Cl ass.java:303)
at SQL.main(SQL.ja va: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.jc c.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.T2Configura tion.<clinit>(T 2Configuration. java:70)
at com.ibm.db2.jcc .DB2Driver.conn ect(DB2Driver.j ava:178)
at java.sql.Driver Manager.getConn ection(DriverMa nager.java:
525)
at java.sql.Driver Manager.getConn ection(DriverMa nager.java:
193)
at SQL.main(SQL.ja va: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.jd bc.net.DB2Drive r) 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.jd bc.app.DB2Drive r),
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.SQLExc eption: java.lang.Unsat isfiedLinkError : /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.jc c.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**********@sp amonly.de; egg bacon and spam; egg bacon sausage
and tr**********@sp amonly.net; spam bacon sausage and spam; spam
egg spam spam bacon and tr**********@ni xwill.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
3944
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', 'password') FROM dual; CHECK_PASSWD('USER','PASSWORD')
2
5288
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 create XML files out of the DB2 data using the XML collections method and SQL mapping. I successfully enabled my database, put the collection.dtd into DTD_REF, created a DAD file and enabled the collection (xcolltest01) using the OS/400 command...
3
13384
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. SQLSTATE=08S01 Below is the following code I am using. I did not specify the port number but even when I try specify it I get the same error.
2
2190
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. However, I can't log on from my webapp to the database thru jdbc like I could when my webapp/Tomcat/postgresql were on my local machine. The jdbc class only has a method with 3 parameters, url, user, password parameters. The hosting server is...
1
2018
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 password has a "|" character in it. If I do this, I get an exception stating that the password is invalid. This is what I execute ...
3
10273
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 to provide username and password, the Java API DriverManger.getConnection(String url) does not work. I am not sure if this is because the JDBC driver, or because it does not work for DB2 under solaris. Any comments? Thanks a lot!
2
1223
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: invalid username/password; logon denied Exception: null ORA-01017: invalid username/password; logon denied Exception: null Im not sure where exactly the problem but i tried alot with this code line:
1
5353
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 though SQL Server IS in mixed authentication mode. Does mixed mode mean you can connect either way, but only using MS SQL Server interfaces (like Mgmt Studio), and not something like JDBC? Can we connect using JDBC w/ an AD login? If so, what form...
0
2867
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 \"TEST\".\"TABLE1\" WHERE COL2 like '%㈱%' It returns nothing. So I want to try to set the codepage(the same code page that db uses) in JDBC level to see if it retrieves something. Here is what I am trying. But I am not sure if I am using valid...
1
4574
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 IP:port No String dbsid = "TESTSID"; //SID Name or Service Name String username = "TESTUSER"; //Database user String password = "password"; //User password
0
8946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8776
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9310
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9236
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9182
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2724
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.