java DB2 program

i log in my mainframe environment using my user id and password ..

After that i go to QMF and fire my DB2 queries...

I want to read the DB2 tables , through my JAVA program..can anybody please guide on how i can od the connection to the DB2 database and what drivers are required..i am using Java 1.4

[319 byte] By [anaik100a] at [2007-10-2 14:25:34]
# 1
JDBC.Internet search for "java jdbc tutorial" should get you started.
DrClapa at 2007-7-13 12:45:07 > top of Java-index,Java Essentials,Java Programming...
# 2
DrCalp, i know about JAVA JDBC...i am interested in things specifice to JAVA DB2...i know about connection through Oracle..so if you can help me can you please let me know about DB2
anaik100a at 2007-7-13 12:45:07 > top of Java-index,Java Essentials,Java Programming...
# 3
any help on this
anaik100a at 2007-7-13 12:45:07 > top of Java-index,Java Essentials,Java Programming...
# 4
DB2 is just another database, that you access via JDBC. There's nothing more to say to add to what DrClap already said, other than you'll need to know what the JDBC URL will look like to connect to that database. So add DB2 to your search string.
warnerjaa at 2007-7-13 12:45:07 > top of Java-index,Java Essentials,Java Programming...
# 5
Do you want to know how to execute queries once you are connected? Your question is a little vague...Statement statement = conn.createStatement();ResultSet rs = statement.executeQuery(query);
Autolykosa at 2007-7-13 12:45:07 > top of Java-index,Java Essentials,Java Programming...
# 6
My speicifc questions are1. which library to import of db2 drivers..2. DriverManager.registerDriver(driver name for DB2)3. DriverManager.getConnection(what should be there over here for DB2);
anaik100a at 2007-7-13 12:45:07 > top of Java-index,Java Essentials,Java Programming...
# 7
> My speicifc questions aredid you hit Google? I did, and it gave me: http://sis36.berkeley.edu/projects/streek/howto/testCallProcedureJava.html http://www.db2mag.com/story/showArticle.jhtml?articleID=23902546 http://datacentral.sdsc.edu/sample.javaLee
tsitha at 2007-7-13 12:45:07 > top of Java-index,Java Essentials,Java Programming...
# 8

Well, when I wrote my application using jdbc, I had to scrounge the net for free drivers.

DriverManager.registerDriver(new DB2Driver());

Connection conn = DriverManager.getConnection(url, username, password);

the url string structure should be documented with whatever driver you download. I prefer the 3 argument version of getConnection, but many drivers will allow you to put the username and password in the url itself.

Autolykosa at 2007-7-13 12:45:07 > top of Java-index,Java Essentials,Java Programming...