Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ODBC driver for DB2

1 view
Skip to first unread message

kenck4

unread,
Jul 8, 2002, 10:32:23 AM7/8/02
to
Hi guys,

I seriously need help here. As I am not very proficent in database but
was task to solve a problem by my boss.

Can anyone point me to a site where i can download the ODBC driver for
DB2 so that I can use it to communicate between MS Access and DB2?

How should I go about installing the driver?

thanks in advance.

rhino

unread,
Jul 8, 2002, 11:15:14 AM7/8/02
to
You may not need to download anything.

Assuming you are running some version of Windows and that your program will
be written in Java, you should find everything you need to talk to your
Access database already on your machine.

I was handed a similar task this past Friday. I found that if you go to
Start/Settings/Control Panel/Administrative Tools/Data Sources on a
Windows2000 machine, you will find a set of dialogues already there which
can set up your Access database. I understand that this set of dialogues is
standard on Windows machines, although it might be in slightly different
places on other versions of Windows.

My task is to create a Java program that can read and write to the Access
database via the JDBC/ODBC bridge. All I had to do was install the Access
.MDB file on my PC, set it up as a System DSN (although I could probably
have made it a User DSN or a File DSN and still gotten it to work), and add
one import statement to my Java program:
import sun.jdbc.odbc.*;

I used the following code to establish my connection:
try {
DriverManager.registerDriver (new JdbcOdbcDriver());
String database = "EMC_Access_DB";
String userid = "admin";
String password = "";
conn01 = DriverManager.getConnection ("jdbc:odbc:"+database, userid,
password);
conn01.setAutoCommit(false);
}
catch (Exception e) {
System.err.println("Exception: " + e);
}

Everything else was standard JDBC code. Most of my code is working already;
the only problems I'm finding are related to the fact that the Access
datatypes aren't particularly well-suited to the data that I want to put
into Access but that probably won't be an issue for you.

Rhino

"kenck4" <ken...@yahoo.com> wrote in message
news:3f60968b.02070...@posting.google.com...

Gerald Meazell

unread,
Jul 8, 2002, 1:54:10 PM7/8/02
to
Install the DB2 Client on your PC and the ODBC driver will be installed
automatically.
0 new messages