Glassfish上的JDBC连接池详细信息

在为实体类configuration会话Bean的上下文中,我可以从Ubuntu上的 Glassfish v4获得一些关于使用asadmin从CLI获取JDBC连接池的基本信息,但是想要通过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:~$ 

如何通过Web界面获取连接的所有参数的详细信息:

在这里输入图像说明

来自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> 

也可以看看:

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

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

您可以通过asadmin获取详细asadmin

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

例如

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

另外,连接池的细节在哪里存储?

域/域1 /configuration/ domain.xml中