Ubuntu – JDBC Connection Pool details on Glassfish

glassfishjavajdbcUbuntu

In the context of configuring Session Beans for Entity Classes, I can get some basic information from Glassfish v4 on Ubuntu about the JDBC connection pool from the CLI with asadmin, but would like to get more detail through the CLI:

thufir@dur:~$ 
thufir@dur:~$ glassfish-4.1/glassfish/bin/asadmin
Use "exit" to exit and "help" for online help.
asadmin> 
asadmin> list-jdbc-connection-pools
CLI031: Warning: Option "target" is obsolete and will be ignored.
CLI031: Warning: Option "target" is obsolete and will be ignored.
__TimerPool
DerbyPool
SamplePool
connectionPool
legacy_on_glassfish
Command list-jdbc-connection-pools executed successfully.
asadmin> 
asadmin> ping-connection-pool legacy_on_glassfish
Command ping-connection-pool executed successfully.
asadmin> 
asadmin> list-jdbc-resources
jdbc/sample
jdbc/__TimerPool
jdbc/__default
jdbc/local
jdbc/legacy_resource
Command list-jdbc-resources executed successfully.
asadmin> 
asadmin> exit
Command multimode executed successfully.
thufir@dur:~$ 

How do I get the full details, all the parameters of the connection, as through the web interface:

enter image description here

Some of the connection pool details from domains/domain1/config/domain.xml:

<jdbc-connection-pool connection-validation-method="auto-commit" datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" wrap-jdbc-objects="false" res-type="javax.sql.DataSource" name="connectionPool">
  <property name="URL" value="jdbc:mysql://&lt;HOST&gt;:&lt;PORT&gt;/&lt;DB&gt;?relaxAutoCommit=&quot;true&quot;"></property>
  <property name="Password" value="password"></property>
  <property name="User" value="jdbc"></property>
</jdbc-connection-pool>
<jdbc-resource pool-name="connectionPool" jndi-name="jdbc/local"></jdbc-resource>
<jdbc-connection-pool datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource" res-type="javax.sql.ConnectionPoolDataSource" name="legacy_on_glassfish">
  <property name="User" value="jdbc"></property>
  <property name="AutoReconnectForPools" value="false"></property>
  <property name="LoggerClassName" value="com.mysql.jdbc.log.StandardLogger"></property>
  <property name="RetriesAllDown" value="120"></property>
  <property name="IgnoreNonTxTables" value="false"></property>
  <property name="ProfilerEventHandler" value="com.mysql.jdbc.profiler.LoggingProfilerEventHandler"></property>

see also:

https://glassfish.java.net/nonav/v3/admin/planning/j109/admin-cli.html#latestversion

https://glassfish.java.net/docs/4.0/administration-guide.pdf

Best Answer

You can get the details via asadmin:

asadmin get domain.resources.jdbc-connection-pool.NAME_OF_THE_CONNECTION_POOL.*

e.g.

asadmin get domain.resources.jdbc-connection-pool.PostgresConnectionPool.*