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

Andrig Miller anmiller at redhat.com
Tue Mar 22 12:11:05 EDT 2011


Brian,

    I was able to successfully create a mysql module for my data source.  It was pretty simple actually.  Not bad, considering my first try at it.

Thanks for the pointers.

Andy

----- Original Message -----
> From: "Brian Stansberry" <brian.stansberry at redhat.com>
> To: jboss-as7-dev at lists.jboss.org
> Sent: Friday, March 18, 2011 1:48:13 PM
> Subject: Re: [jboss-as7-dev] Anyone write up how to create your own data source on AS 7?
> 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
> _______________________________________________
> 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