maybe this can help..
to create a connection pool, use the application server admin console
default on
http://localhost:4848 on the JDBC - Connection Pool - create new here's an example
Name : MySQLPool
ResourceType : java.sql.DataSource
Vendor : Mysql
Data Source class name : com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
and add the following property
user : db_user
password : db_password
port : 3306 (mysql default)
that's it. remember to put the MySQL connector/J jar file to the server classpath
and then create a JDBC Resources afterward
for ex,
JNDI name : jdbc/MySQL
PoolName MySQLPool --> use the pool u've created b4
status enabled
To create a connection to this pool simple use this code on the init section:
InitialContext ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup("jdbc/MySQL");
Connection conn = ds.getConnection() ;
//"creating statement.."
Statement stmt = conn.createStatement();
and do rest of the query as usual
hope it will help
Regards,
Bayu