Update to Using JDBC Connection Pools on Glassfish
September 12th, 2007 by Lou
If you would like to use the command line to configure Glassfish for JDBC/JNDI resources, versus the web GUI method described in my previous post, Arun has has provided this in step 5 some instructions. This replaces the Glassfish GUI steps in my post. Jagadish has some more detailed instructions for configuring JDBC connection pools in his blog entry on the subject
Arun’s example specifies the MysqlConnectionPoolDataSource interface, which is the right interface to use for a connection pool. For the example I gave with a connection pool named "roadmap", a JNDI entry named "jdbc/roadmap" and a MySQL database named "roadmap_development" authenticated by "root" and password "secret", the command line version would be as follows:
asadmin login
asadmin create-jdbc-connection-pool --datasourceclassname com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource --restype javax.sql.DataSource --property User=root:Password=secret:Url="jdbc\:mysql\://localhost/roadmap_development" roadmap
asadmin create-jdbc-resource --connectionpoolid roadmap jdbc/roadmap