JBoss Community

Re: Deploying JDBC drivers and Datasources via jboss-cli.sh

created by Keith Hall in Beginner's Corner - View the full discussion

It's a bit confusing in the domain cli as the datasources are found in the /host/server/subsystem as well as /profile/subsystem/

However if you try looking at the available operations:

[domain@127.0.0.1:9999 /] /host=master/server=server-three/subsystem=datasources/:read-operation-names

{

    "outcome" => "success",

    "result" => [

        "get-installed-driver",

        "installed-drivers-list",

        "read-attribute",

        "read-children-names",

        "read-children-resources",

        "read-children-types",

        "read-operation-description",

        "read-operation-names",

        "read-resource",

        "read-resource-description"

    ]

}

[domain@127.0.0.1:9999 /] /profile=full-ha/subsystem=datasources/:read-operation-names

{

    "outcome" => "success",

    "result" => [

        "add",

        "read-attribute",

        "read-children-names",

        "read-children-resources",

        "read-children-types",

        "read-operation-description",

        "read-operation-names",

        "read-resource",

        "read-resource-description",

        "remove",

        "undefine-attribute",

        "whoami",

        "write-attribute"

    ]

}

 

As you can see there is no add operation in the /host=master/server=server-three/subsystem=datasources node !!!

Here's how I added the oracle jdbc driver to the full-ha profile in the domain - you will need to alter to suit mysql and relevant profile etc

 

 

/profile=full-ha/subsystem=datasources/jdbc-driver=oracle:add( \

    driver-name="oracle", \

    driver-module-name="com.oracle.ojdbc6", \

    driver-xa-datasource-class-name="oracle.jdbc.driver.OracleDriver" \

)

 

and here's a datasource

/profile=full-ha/subsystem=datasources/data-source=DefaultDS:add( \

    driver-name="oracle", \

    connection-url="jdbc:oracle:thin:@192.168.0.1:1521:orcl", \

    jndi-name="java:/DefaultDS", \

    user-name="user", \

    password="pass", \

    driver-class="oracle.jdbc.driver.OracleDriver", \

    min-pool-size=25, \

    max-pool-size=100, \

    pool-prefill=true, \

    transaction-isolation="TRANSACTION_READ_COMMITTED" \

)

 

enable it

/profile=full-ha/subsystem=datasources/data-source=DefaultDS:enable

 

and test it

 

/host=master/server=server-three/subsystem=datasources/data-source=DefaultDS/:test-connection-in-pool

Reply to this message by going to Community

Start a new discussion in Beginner's Corner at Community