aspose file tools*
The moose likes Tomcat and the fly likes tomcat server is not connecting to db2 database or any other database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "tomcat server is not connecting to db2 database or any other database" Watch "tomcat server is not connecting to db2 database or any other database" New topic
Author

tomcat server is not connecting to db2 database or any other database

chaitanya karthikk
Ranch Hand

Joined: Sep 15, 2009
Posts: 806



hi everybody, i am chaitanya, i have a serious problem with tomcat6.0 server. i am struggling since 2 days.

Previously i developed a web application using websphere application server. now i migrated my server from websphere application server to tomcat6.0 server.

previously i developed the application with websphere and java1.4 and ibm db2.

i am using ibm db2 database. i used user dsn to connect to database through my application. it was successful. recently i came to know that we have to use system dsn to connect to database. i modified the connection. again it was a success.

now i migrated to tomcat6.0 and java1.5 and ibmdb2.

i just deployed my application on tomcat6.0. the deployment was successful. when i am trying to execute the project an error is coming. the application is unable to connect to database.

this is the error message when i am trying to connect with system dsn.
----------------java.sql.SQLException: [IBM][CLI Driver][DB2/NT] SQL0204N "SYSTEM.EMP_DETAILS" is an undefined name. SQLSTATE=4270

this is the error message when i am trying to connect with user dsn.
----------------java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified


i thought that the problem is with java1.5. so i reconfigured the server with java1.4. the installation of tomcat6.0 was sucess. but the server is not starting. so i once again reconfigured the server with java1.5. then the server started. why is this happening?

i thought that the problem lies with the database so i shifted the database to oracle. then also the same problem is arising.

please help me in this regard.


Love all, trust a few, do wrong to none.
Ram Para
Ranch Hand

Joined: Jul 09, 2008
Posts: 50
No this is not the problem with Java.
DB2 uses your user name as the default schema. When you are trying to connect using System DSN it us using system as the schema name.(this is how DB2 behaves)

for this you can use schema in your mappings or you can use a user name same as schema name.


Ram Parashar
http://doinfinite.com
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16305
    
  21

Hi Anusha. DON'T use the JDBC/ODBC bridge driver. It's water buffalo dung, except that if you spread it on plant's they'll die. It's only intended as a last-resort facility when no better driver is available. In the case of DB2, IBM provides several native DB2 UDB JDBC drivers and you should be using one of those.


Customer surveys are for companies who didn't pay proper attention to begin with.
chaitanya karthikk
Ranch Hand

Joined: Sep 15, 2009
Posts: 806

hi everybody, thanks for all of you for being with me and suggesting me, i learned how to connect to database using type4 drivers
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: tomcat server is not connecting to db2 database or any other database