View Single Post
Old 05-10-2004, 12:33 PM   #4 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,489
sde is on a distinguished road
got it working now. for the sake of anyone searching the forums in the future, here's the solution i found.

Code:
import com.ibm.as400.access.*;
import java.sql.*;

public class test{
  // declare data source and con
  private static AS400JDBCConnectionPoolDataSource ds;
  private Connection con;

  // constructor
  test(){
    ds = new AS400JDBCConnectionPoolDataSource("myAS400","user","pass");
    ds.setLibraries("library");
    ds.setDateFormat("iso");
  }

  // get connection from the pool
  private Connection getConnection(){
    Connection c = null;
    
    try{      
      javax.sql.PooledConnection pc = ds.getPooledConnection();
      c = pc.getConnection();

    }catch(Exception e){
      //
    }
    
    return c;
  }
}
this was done by experimenting, trial and error .. so if someothing looks bad, someone please let me know =)
__________________
Mike
sde is offline   Reply With Quote