Book Image

WildFly Configuration, Deployment, and Administration

Book Image

WildFly Configuration, Deployment, and Administration

Overview of this book

Table of Contents (19 chapters)
WildFly Configuration, Deployment, and Administration Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Datasources


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

  • Add a datasource:

    data-source add --jndi-name=java:/MySqlDS --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 a datasource:

    data-source remove --name=java:/MySqlDS
    

Datasources (using operations on resources)

You can also operate on a datasource using operations on the data sources subsystem:

  • List the installed drivers:

    /subsystem=datasources:installed-drivers-list
    
  • Add a datasource:

    data-source add --jndi-name=java:/MySqlDS --name=MySQLPool --connection-url=jdbc:mysql://localhost:3306/MyDB --driver-name=mysql-connector-java-5.1.30-bin.jar --user-name=myuser --password=password --max-pool-size=30
    
  • Add an XA datasource (using an operation):

    xa-data-source add --name=MySQLPoolXA --jndi-name=java:/MySqlDSXA --driver-name=mysql-connector-java-5.1.30-bin.jar -xa-datasource-properties=[{ServerName=localhost}{PortNumber=3306}]
    
  • Remove a datasource (using an operation):

    /subsystem=datasources/data-source=testDS:remove