View Single Post
Old 05-18-2004, 03:31 PM   #10 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,487
sde is on a distinguished road
ok thanks, that helps. i do have an object which i'm using which returns a PooledConnection.

my pages are taking 2-4 seconds to load, and 2 of those seconds are the connection opening.

your words have me definately thinking of alternative ways .. i'll keep testing times through tomorrow.

in case you were curious, here is a snippet of my class:
Code:
private static AS400JDBCConnectionPoolDataSource ds;
private static javax.sql.PooledConnection pool;
private Connection con;

public as400(){    
  try{      
    ds = new AS400JDBCConnectionPoolDataSource("10.10.10.1","USER","PASS");
    ds.setLibraries("RC1380BFR1");
    ds.setDateFormat("iso");
          
    pool = ds.getPooledConnection();

    }catch(Exception e){
      System.out.println("as400() " + e.toString());
    }
  }

  private Connection getConnection(){
  
  Connection c = null;
  
  try{ 
    c = pool.getConnection();
    
  }catch(Exception e){
    System.out.println("getConnection() " + e.toString());
  }
  
  return c;
}
and here is how i get the connection
Code:
if(con == null || con.isClosed())
  con = pool.getConnection();
__________________
Mike
sde is offline   Reply With Quote