[jboss-user] [Beginner's Corner] - Re: Deploying JDBC drivers and Datasources via jboss-cli.sh

Keith Hall do-not-reply at jboss.com
Tue Dec 11 10:48:48 EST 2012


Keith Hall [https://community.jboss.org/people/keith_hall] created the discussion

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

To view the discussion, visit: https://community.jboss.org/message/782843#782843

--------------------------------------------------------------
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 at 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 at 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
[https://community.jboss.org/message/782843#782843]

Start a new discussion in Beginner's Corner at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20121211/1eaf199a/attachment-0001.html 


More information about the jboss-user mailing list