How to check datasource in JBoss?

20,270

Solution 1

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.

Solution 2

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/

Solution 3

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

Share:
20,270
IAdapter
Author by

IAdapter

Updated on September 04, 2020

Comments

  • IAdapter
    IAdapter over 3 years

    I have a datasource, how to check if its ok? maybe somehow using jmx-console?