In this article is showed a list of useful commands that run on GlassFish 3.1.

Datasource

Create connection pool

asadmin create-jdbc-connection-pool --datasourceclassname=com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource --restype=javax.sql.ConnectionPoolDataSource --property portNumber=3306:password=password:user=username:url=jdbc:mysql://localhost:3306/MyDatabase MyPool

Check connection pool

asadmin ping-connection-pool MyPool

Create datasource

asadmin create-jdbc-resource --connectionpoolid MyPool jdbc/MyDS

JMS

Create Connection Factory

asadmin create-jms-resource --restype javax.jms.ConnectionFactory jms/javaee6/ConnectionFactory

Create Queue

asadmin create-jms-resource --restype javax.jms.Queue jms/javaee6/Queue

Create Topic

asadmin create-jms-resource --restype javax.jms.Topic jms/javaee6/Topic

Check resources

asadmin list-jms-resources