O'Reilly logo

JBoss AS 7 Configuration, Deployment, and Administration by Francesco Marchioni

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Datasources

This is a list of handy datasource commands that can be issued using the datasource alias:

  • Add datasource:
    data-source add --jndi-name=java:/MySqlDS --pool-name=MySQLPool -- connection-url=jdbc:mysql://localhost:3306/MyDB --driver- name=mysql-connector-java-5.1.16-bin.jar --user-name=myuser -- password=password --max-pool-size=30
    
  • Remove datasource:
    data-source remove --jndi-name=java:/MySqlDS
    

Datasources (using operation on resources)

You can also operate on a datasource using operation on the datasources subsystem:

  • List installed drivers:
    /subsystem=datasources:installed-drivers-list
    
  • Add datasource:
    /subsystem=datasources/data-source=testDS:add(jndi- name=java:jboss/datasources/MyDB, pool-name= MySQLPool, driver- name=mysql-connector-java-5.1.16-bin.jar, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required