wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes DB2 datasource lookup in WSAD, SQLSTATE=42705 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "DB2 datasource lookup in WSAD, SQLSTATE=42705" Watch "DB2 datasource lookup in WSAD, SQLSTATE=42705" New topic

DB2 datasource lookup in WSAD, SQLSTATE=42705

Sam Gehouse
Ranch Hand

Joined: Jul 21, 2003
Posts: 281
I look up my datasource using jndi from WSAD 5.1 Test Server.

But it throws an exception when I call getConnection() on that datasource.

Username and pwd are set in Security tab of WSAD for that datasource. I think I am not getting connected cause of security constraint.

I tried using overloaded method of geConnection that sets userName and pwd. But no luck.

I get error below. Any thoughts?

Has anyone encountered Mapping the following SQLException, with ErrorCode -1,013 and SQLState 08001, to a StaleConnectionException: COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver] SQL1013N The database alias name or database name "SAMPLE" could not be found. SQLSTATE=42705

Pleasde note that the datasource and databse name is different from SAMPLE that I see in exception. There is no database called SAMPLE. I am connecting to DB2 database. SAMPLE may be something used by DB2 itself. Name of database schema is not SIMPLE either.

I can connect to the same DB2 database from the same local computer. It fails when I use getConnection() method within Java code.
Jeanne Boyarsky
internet detective

Joined: May 26, 2003
Posts: 30123

I answered in your other thread.

[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
I agree. Here's the link: http://aspose.com/file-tools
subject: DB2 datasource lookup in WSAD, SQLSTATE=42705
Similar Threads
Reg DB2 sample database
cannot connect to database
Kyle's 2nd ED
question about getConnection(usr,pwd)
Datasource JNDI Lookup in WSAD from standalone app