Tomcat ODBC via DB2

S

spinel

Anyone know what driver Tomcat needs to call an DB2 ODBC connection?

I'm not sure if that was said properly but basically, we need to
connect to a DB2 database via an ODBC connection. The DB2 client is
installed on the same tomcat server and we've also created an ODBC
connection. This connection has been verified and we're able to connect
to DB2 via command line or even see the tables via MS Access. We now
want to call on this ODBC from a tomcat application. I understand the
format in modifying the server.conf file when adding a new application
but i'm not sure how to do the same for DB2 via an ODBC connection. Can
anyone help? Thanks!
 
R

Rhino

spinel said:
Anyone know what driver Tomcat needs to call an DB2 ODBC connection?

I'm not sure if that was said properly but basically, we need to
connect to a DB2 database via an ODBC connection. The DB2 client is
installed on the same tomcat server and we've also created an ODBC
connection. This connection has been verified and we're able to connect
to DB2 via command line or even see the tables via MS Access. We now
want to call on this ODBC from a tomcat application. I understand the
format in modifying the server.conf file when adding a new application
but i'm not sure how to do the same for DB2 via an ODBC connection. Can
anyone help? Thanks!

Try asking on a DB2 newsgroup, like comp.databases.ibm-db2, or a Tomcat
mailing list, or maybe comp.lang.java.databases. Any of those three would be
more appropriate than comp.lang.java.programmer.

You should also think about using JDBC rather than ODBC.
[/QUOTE]
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

spinel said:
Anyone know what driver Tomcat needs to call an DB2 ODBC connection?

I'm not sure if that was said properly but basically, we need to
connect to a DB2 database via an ODBC connection. The DB2 client is
installed on the same tomcat server and we've also created an ODBC
connection. This connection has been verified and we're able to connect
to DB2 via command line or even see the tables via MS Access. We now
want to call on this ODBC from a tomcat application. I understand the
format in modifying the server.conf file when adding a new application
but i'm not sure how to do the same for DB2 via an ODBC connection.

JDBC - ODBC bridge and DSN:

driver = sun.jdbc.odbc.JdbcOdbcDriver
connection url = jdbc:eek:dbc:yourdsn

JDBC - ODBC bridge and DSNless:

driver = sun.jdbc.odbc.JdbcOdbcDriver
connection url = jdbc:eek:dbc:;Driver={IBM DB2 ODBC
DRIVER};DBAlias=yourdb;Uid=xxxx;Pwd=xxxx;

Real JDBC driver:

driver = com.ibm.db2.jcc.DB2Driver
connection URL = jdbc:db2://localhost:50000/yourdb

I can strongly recommend you to use the real JDBC driver.

The JDBC ODBC bridge in a multithreaded context like
Tomcat is a disaster !

Arne


Arne
 
S

Simon Brooke

spinel said:
Anyone know what driver Tomcat needs to call an DB2 ODBC connection?

I'm not sure if that was said properly but basically, we need to
connect to a DB2 database via an ODBC connection.
Why?

The DB2 client is
installed on the same tomcat server and we've also created an ODBC
connection. This connection has been verified and we're able to connect
to DB2 via command line or even see the tables via MS Access. We now
want to call on this ODBC from a tomcat application. I understand the
format in modifying the server.conf file when adding a new application
but i'm not sure how to do the same for DB2 via an ODBC connection. Can
anyone help? Thanks!

The JDBC-ODBC bridge driver should do it, but I wouldn't recommend it.
 
G

gryphon_smg

As the others wrote, you don't want to be using ODBC with Tomcat, you
want to use JDBC. The other thing to think about is that the IBM JDBC
driver for DB2400 is somewhat broken. It does not fully support the
JDBC 3.0 spec and does not work with some popular open source database
related software, rendering it very difficult to use effectively. IBM
does not seem to think it is a very big issue and has not given a time
frame for fixing it. We are migrating as much of our data to better
supported databases as fast as we can.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top