[jboss-as7-dev] Anyone write up how to create your own data source on AS 7?

Brian Stansberry brian.stansberry at redhat.com
Fri Mar 18 15:48:13 EDT 2011


On 3/18/11 11:00 AM, Andrig Miller wrote:
> Has anyone written up how you create your own data source in AS 7 Beta 1?
>

I'm not aware of one, no. JIRA to fix that is [1].

> I'm trying to bring across my mysql-ds.xml into the configuration, but
> there are some tags that I don't understand (module stuff),

The <datasource><module> element is confusing, as it's oddly named for 
the way it's used in the AS.[2]

The value should be

driver-fqcn#<driver-major-version.driver-minor-version

where driver-fqcn is the name of the class that implements driver.

There are two ways to make the driver available.

Simpler is by deploying the driver jar (same as you'd deploy a war, etc).

More complex is by creating a module for it in the modules/ dir; e.g. 
$JBOSS_HOME/modules/com/h2database/h2 and then adding a child element 
under <subsystem xmlns="urn:jboss:domain:datasources:1.0"><drivers>. A 
jar in the module needs to include a META-INF/services/java.sql.Driver 
file whose contents are the FQCN of the java.sql.Driver implementation. 
(The AS loads the driver from the module using java.util.ServiceLoader).

> and I'm also
> not sure about the carry over of things like transaction-isolation and
> connection-property tags.
>

Don't know if [3] will help.


[1] https://issues.jboss.org/browse/JBAS-9062

[2] https://issues.jboss.org/browse/JBAS-9061

[3] 
http://docs.jboss.org/ironjacamar/userguide/1.0/en-US/html/deployment.html#deployingds_descriptor




-- 
Brian Stansberry
Principal Software Engineer
JBoss by Red Hat



More information about the jboss-as7-dev mailing list