Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Testing Database Connection in Jboss

I have done necessary configurations by adding JDBC driver in modules, creating modules.xml and then adding necessary datasource configuration in standalone.xml file. I want know if it is done successfully. Is there any way to check that. Is there any way to test database connectivity. My jboss server is running on a linux system and postresql db server is running in another VM instance.

like image 509
Not a Coder Avatar asked Dec 18 '25 19:12

Not a Coder


1 Answers

You can test database connectivity by the following steps:

  1. Go to the JBOSS_HOME/bin folder and execute ./jboss-cli.sh. This opens the JBoss CLI.
  2. Enter:
    connect 
    
  3. Enter:
    /subsystem=datasources/data-source=name_of_your_datasource:test-connection-in-pool
    

The name_of_your_datasource is the name of the datasource in your standalone.XML.

You should see something like:

{"outcome" => "success","result" => [true]}
like image 58
ChristianH Avatar answered Dec 20 '25 12:12

ChristianH



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!