我可以通过以下方式从 CLI 中的 Glassfish v4 获取有关 JDBC 连接池的一些基本信息asadmin
:
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 界面获取完整的详细信息和连接的所有参数:
另外,连接池详细信息存储在哪里?
也可以看看:
https://glassfish.java.net/nonav/v3/admin/planning/j109/admin-cli.html#latestversion
https://glassfish.java.net/docs/4.0/administration-guide.pdf
答案1
如果您需要完整的信息,也可以在这里使用它:
asadmin get domain.resources.jdbc-connection-pool.*
答案2
这有效:
asadmin>
asadmin> get domain.resources.jdbc-connection-pool.legacy_on_glassfish
domain.resources.jdbc-connection-pool.legacy_on_glassfish.allow-non-component-callers=false
domain.resources.jdbc-connection-pool.legacy_on_glassfish.associate-with-thread=false
domain.resources.jdbc-connection-pool.legacy_on_glassfish.connection-creation-retry-attempts=0
domain.resources.jdbc-connection-pool.legacy_on_glassfish.connection-creation-retry-interval-in-seconds=10
domain.resources.jdbc-connection-pool.legacy_on_glassfish.connection-leak-reclaim=false
domain.resources.jdbc-connection-pool.legacy_on_glassfish.connection-leak-timeout-in-seconds=0
domain.resources.jdbc-connection-pool.legacy_on_glassfish.connection-validation-method=table
domain.resources.jdbc-connection-pool.legacy_on_glassfish.datasource-classname=com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
domain.resources.jdbc-connection-pool.legacy_on_glassfish.deployment-order=100
domain.resources.jdbc-connection-pool.legacy_on_glassfish.fail-all-connections=false
domain.resources.jdbc-connection-pool.legacy_on_glassfish.idle-timeout-in-seconds=300
domain.resources.jdbc-connection-pool.legacy_on_glassfish.is-connection-validation-required=false
domain.resources.jdbc-connection-pool.legacy_on_glassfish.is-isolation-level-guaranteed=true
domain.resources.jdbc-connection-pool.legacy_on_glassfish.lazy-connection-association=false
domain.resources.jdbc-connection-pool.legacy_on_glassfish.lazy-connection-enlistment=false
domain.resources.jdbc-connection-pool.legacy_on_glassfish.match-connections=false
domain.resources.jdbc-connection-pool.legacy_on_glassfish.max-connection-usage-count=0
domain.resources.jdbc-connection-pool.legacy_on_glassfish.max-pool-size=32
domain.resources.jdbc-connection-pool.legacy_on_glassfish.max-wait-time-in-millis=60000
domain.resources.jdbc-connection-pool.legacy_on_glassfish.name=legacy_on_glassfish
domain.resources.jdbc-connection-pool.legacy_on_glassfish.non-transactional-connections=false
domain.resources.jdbc-connection-pool.legacy_on_glassfish.object-type=user
domain.resources.jdbc-connection-pool.legacy_on_glassfish.ping=false
domain.resources.jdbc-connection-pool.legacy_on_glassfish.pool-resize-quantity=2
domain.resources.jdbc-connection-pool.legacy_on_glassfish.pooling=true
domain.resources.jdbc-connection-pool.legacy_on_glassfish.res-type=javax.sql.ConnectionPoolDataSource
domain.resources.jdbc-connection-pool.legacy_on_glassfish.statement-cache-size=0
domain.resources.jdbc-connection-pool.legacy_on_glassfish.statement-cache-type=
domain.resources.jdbc-connection-pool.legacy_on_glassfish.statement-leak-reclaim=false
domain.resources.jdbc-connection-pool.legacy_on_glassfish.statement-leak-timeout-in-seconds=0
domain.resources.jdbc-connection-pool.legacy_on_glassfish.statement-timeout-in-seconds=-1
domain.resources.jdbc-connection-pool.legacy_on_glassfish.steady-pool-size=8
domain.resources.jdbc-connection-pool.legacy_on_glassfish.validate-atmost-once-period-in-seconds=0
domain.resources.jdbc-connection-pool.legacy_on_glassfish.wrap-jdbc-objects=true
Command get executed successfully.
asadmin>
按照: