How to check datasource in JBoss?
Asked Answered
S

4

8

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

Sneaking answered 6/3, 2011 at 17:55 Comment(2)
Which JBoss version are you using?Lymphosarcoma
jboss-4.2.1.GA, but if its possible in another I can switch.Sneaking
D
9

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.

Divot answered 6/3, 2011 at 20:1 Comment(0)
P
4

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/

Pose answered 4/11, 2011 at 11:38 Comment(0)
C
1

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

Chiseler answered 28/4, 2015 at 9:57 Comment(0)
S
1

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

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

Scabrous answered 4/9, 2018 at 1:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.