[jboss-as7-dev] "driver-name" attribute while creating the JDBC driver

Jaikiran Pai jpai at redhat.com
Mon Mar 5 02:06:11 EST 2012


Bumping this, since many developers were on vacation when this was sent 
soon after 7.1.0 release.

-Jaikiran
On Friday 17 February 2012 03:53 PM, Jaikiran Pai wrote:
> I was trying out creation of a JDBC driver through the management
> operation. Initially I used this operation:
>
> [standalone at localhost:9999 /]
> /subsystem=datasources/jdbc-driver=mysql-5-driver:add(driver-module-name=mysql,
> driver-class-name=com.mysql.jdbc.Driver)
>
> Note that it _doesn't_ specify the "driver-name" attribute. However, it
> failed with:
>
> {
>       "outcome" =>  "failed",
>       "failure-description" =>  "JBAS014749: Operation handler failed: No
> child 'driver-name' exists",
>       "rolled-back" =>  true
> }
>
> (the error message isn't clear by the way, but that's a different matter).
>
> I then had to change the operation to explicitly specify the driver-name
> attribute:
>
> [standalone at localhost:9999 /]
> /subsystem=datasources/jdbc-driver=mysql-5-driver:add(driver-name=mysql-5-driver,
> driver-class-name=com.mysql.jdbc.Driver, driver-module-name=mysql)
>
> That worked fine.
>
> But why is this operation unlike other "add" operations which use the
> value before the ":" as the name of the new resource? By the way, I even
> tried this command:
>
> [standalone at localhost:9999 /]
> /subsystem=datasources/jdbc-driver=foo:add(driver-name=bar,
> driver-class-name=com.mysql.jdbc.Driver, driver-module-name=mysql)
>
> Note that I use "foo" as the resource name for the add operation and
> "bar" as the driver-name attribute value. This creates a driver named
> "bar" in the standalone.xml:
>
> <driver name="bar" module="mysql">
> <driver-class>com.mysql.jdbc.Driver</driver-class>
> </driver>
>
> and there's no reference to "foo" anywhere. So what's the significance
> of using it in the operation?
>
> -Jaikiran
>
>
> _______________________________________________
> jboss-as7-dev mailing list
> jboss-as7-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev



More information about the jboss-as7-dev mailing list