开发者

How to check datasource in JBoss?

开发者 https://www.devze.com 2023-02-14 23:00 出处:网络
I have a datasource, how to check if its ok? maybe somehow using jmx-console?开发者_开发百科If you want just check if data source is installed and some statistic information about it you can read that

I have a datasource, how to check if its ok? maybe somehow using jmx-console?开发者_开发百科


If you want just check if data source is installed and some statistic information about it you can read that bean: jboss.jca:name=DefaultDS,service=ManagedConnectionPool.

You can find such bean for each data source, just change DefaultDS with the data source name.


With JBoss 7, you can use the jboss-admin command line tool to test the datasource. Run this line in jboss-admin (after adjusting the JNDI name of the datasource, and example assuming that it is an XA datasource):

/subsystem=datasources/xa-data-source=java\:jboss/datasources/XAOracleDS:test-connection-in-pool

More details can be found here: http://www.javalinux.it/wordpress/2011/07/14/how-to-create-an-manage-datasources-in-as7/


The above did not work for me, but this worked-

Run this line in jboss-cli:

/subsystem=datasources/xa-data-source=jdbc\/XAOracleDS:test-connection-in-pool


Using Jboss CLI, a datasource (e.g. MyDS) can be targeted directly:

/subsystem=datasources/data-source=MyDS:test-connection-in-pool

0

精彩评论

暂无评论...
验证码 换一张
取 消