Sun WebServer 6.1 SP4 Connection Pool
Hi All,
I need your help, we are trying to implement server's connection pool and the way we are doing is we made one separate java class that gives the connection and close the connection. This class has a method getConnection() and where ever in application we need connection we use this moethod.
public static synchronized Connection getConnection()
{
InitialContext ctx= new InitialContext();
String dsName = "java:comp/env/jdbc/jdbc-empl";
DataSourceds= (javax.sql.DataSource) ctx.lookup(dsName);
conn = ds.getConnection();
return conn;
}
My question is do I need to make this method synchronized? Please help.
Thanks
Message was edited by:
bplboy..

