f



? connect to db2 as400 server

i'm new to database connectivity through java.

can u help/guide  me how to connect to db2 as400 server(os 400) from 
client windows/linux terminal through jdbc .

i'v downloaded the jdbc db2 driver from i-net .

tell me the specification regarding where to place the 
drivers,classes,libraries etc.

Do i need to edit or create the database.properties file 

thanks


-
progpro
-----------------------------------------------------------------------
Posted via http://www.codecomments.co
-----------------------------------------------------------------------
 
0
progprob
10/1/2004 9:15:38 PM
comp.lang.java.databases 3049 articles. 0 followers. samyaksulabh (16) is leader. Post Follow

2 Replies
865 Views

Similar Articles

[PageSpeed] 30

Hi,

you need another driver, you'll find it at
http://www-1.ibm.com/servers/eserver/iseries/toolbox/downloads.htm
its an pure java driver and runs on any java system. The driver class is 
com.ibm.access.AS400JDBCDriver
the url you need is 
jdbc:as400://HostName/DefaultSchema

Dieter Bender

progprob wrote:

> 
> i'm new to database connectivity through java.
> 
> can u help/guide  me how to connect to db2 as400 server(os 400) from a
> client windows/linux terminal through jdbc .
> 
> i'v downloaded the jdbc db2 driver from i-net .
> 
> tell me the specification regarding where to place the
> drivers,classes,libraries etc.
> 
> Do i need to edit or create the database.properties file
> 
> thanks.
> 
> 
> 
> --
> progprob
> ------------------------------------------------------------------------
> Posted via http://www.codecomments.com
> ------------------------------------------------------------------------

0
Dieter
10/2/2004 5:22:46 PM
> i'v downloaded the jdbc db2 driver from i-net .

Hello !

No, you need to download jt400.jar library, if you have IBM Client Access
installed try to search that file.

Then, the connection method is rather simple, see my sample code below ( you
have to change some line to get it works )

/* (non-Javadoc)
  * @see jdbconn.model.dbengine#openConnection()
  */
 public Connection openConnection(String IP,String DBname,String UID,String
PSW) {

  this.server = IP;
  this.dbName = DBname;
  this.uid = UID;

  Connection db2Conn = null;
  try {
              DriverManager.registerDriver(new
com.ibm.as400.access.AS400JDBCDriver());
              db2Conn =
DriverManager.getConnection("jdbc:as400://"+IP+"/"+DBname+";user="+UID+";pas
sword="+PSW);
              return db2Conn;
         } catch (SQLException e) {
            System.out.println("Error while connecting to "+IP+" with
user="+UID);
            System.out.println("SQLException: "+e.getMessage());
            System.out.println("SQLState: "+e.getSQLState());
            System.out.println("Vendor Error: "+e.getErrorCode());
        return null;
         }
 }

Hoping this helps,
ciao
Alberto


0
Alberto
10/8/2004 8:42:24 AM
Reply: