using native jdbc driver on as400

3.4k views Asked by At

I usually use AS400JDBCDriver to connect to AS400 and work with the DB and this works fine both inside and outside AS400.

Now I've developed a class that will run on AS400 and access the DB, but the customer doesn't want to provide credential to access the DB, assuming that the access from inside AS400 should not need a user and password because the user is already logged.

Some time ago I used com.ibm.db2.jdbc.app.DB2Driver instead of com.ibm.as400.access.AS400JDBCDriver to access the AS400 DB from local classes.

My first problem is that I cannot find the class com.ibm.db2.jdbc.app.DB2Driver inside jt400.jar from sourceforge.

The second problem is that, assuming I could find the class com.ibm.db2.jdbc.app.DB2Driver, does this class allow an access without credetials ?

Any hint would be appreciated

Flavio

2

There are 2 answers

3
James Allman On

com.ibm.db2.jdbc.app.DB2Driver is supplied with the Developer Kit for Java and is located in the $JDK_HOME/lib/tools.jar library.

JDK_HOME is in /QIBM/ProdData/Java400/jdkversion for V5R4 and earlier and /QOpenSys/ProdData/JavaVM/jdkversion/architecture for V6R1 and above.

Class Names for IBM i Native and IBM DB2 Connect JDBC Drivers


The credentials are not necessary if you are using a native driver (jt400Native.jar, tools.jar).

0
Thorbjørn Ravn Andersen On

If you run on the AS/400 itself using the jt400/jtopen driver you can connect to "localhost" as user *CURRENT with password *CURRENT and not have to provide actual credentials.

This works both for JDBC connections and AS400 objects (which is used by the JDBC driver).