Jason,
Just so I'm sure I follow you, what you suggestion is solution like this,
right?
Properties cg = new Properties();
cg.put("user", user);
cg.put("password", password);
Connection conn = driverClass.connect(url, cg);
2012/7/31 Jason T. Greene <jason.greene(a)redhat.com>
I can't remember if I replied to this one or not, but a better
solution is
to use the Driver class directly. We should avoid sticking random things in
the global registry which might even end up containing conflicting values.
On 7/24/12 7:53 AM, Flemming Harms wrote:
> Thanks!
>
> I had to do one more thing to make it work with the module class loader,
> since the database driver was loaded in it's own class loader and it was
> not known to the current class loader I had to find a way to make it
> available
>
> I solve it by wrapping the driver in my own class and register the
> driver to the DriverManager
>
> Like this :
> DriverManager.registerDriver(**new DatabaseDriverWrapper(driver))**;
> DriverManager.getConnection(**url, user, password);
>
> 2012/7/23 Tomaž Cerar <tomaz.cerar(a)gmail.com <mailto:
> tomaz.cerar(a)gmail.com>**>
>
>
>
>
> On Mon, Jul 23, 2012 at 5:58 PM, Jason T. Greene
> <jason.greene(a)redhat.com
<mailto:jason.greene@redhat.**com<jason.greene@redhat.com>>>
> wrote:
>
> On 7/23/12 10:51 AM, Jesper Pedersen wrote:
> > On 07/23/2012 11:42 AM, Flemming Harms wrote:
> >> I found a solution to my problem. Had to update the xsd
> schema with an
> >> extra attribute "module" and then user need pack his
JDBC
> driver as module.
> >>
> >> I use the code below to load the model and the driver class.
> >>
> >> Class<?> driverClass =
> >>
> Module.**loadClassFromCallerModuleLoade**
> r(ModuleIdentifier.fromString(**moduleName),
> >> driver);
> >> driverClass.newInstance();
> >>
> >> <outbound-connections>
> >> <database>
> >> <connection module="com.h2database.h2"
> >> driver="org.h2.jdbcx.**JdbcDataSource"
name="db"
> >> url="jdbc:h2:/tmp/test;DB_**CLOSE_DELAY=-1"
username="sa"
> password=""
> >> min-pool-size="10" max-pool-size="20" />
> >> </database>
> >> </outbound-connections>
> >>
> >> Does it make sense?
> >
> > The -ds.xml functionality uses the module through the
> <driver> tag, so
> > this would be similar.
> >
> > Things to watch out for is of course the password attribute -
> it should
> > at least support the vault mechanism I would say.
>
> If you make the attribute definition have expressions=true, it
> will
> automatically enable vault support.
>
> given that you use AD.parseAndSetParameter() when parsing and
> setting field and AD.resolveModelAttribute() when getting data from
> model
>
> --
> Jason T. Greene
> JBoss AS Lead / EAP Platform Architect
> JBoss, a division of Red Hat
> ______________________________**_________________
> jboss-as7-dev mailing list
> jboss-as7-dev(a)lists.jboss.org <mailto:jboss-as7-dev@lists.**
>
jboss.org <jboss-as7-dev(a)lists.jboss.org>>
>
>
https://lists.jboss.org/**mailman/listinfo/jboss-as7-dev<https://lists...
>
>
>
> ______________________________**_________________
> jboss-as7-dev mailing list
> jboss-as7-dev(a)lists.jboss.org
<mailto:jboss-as7-dev@lists.**jboss.org<jboss-as7-dev@lists.jboss.org>
> >
>
>
https://lists.jboss.org/**mailman/listinfo/jboss-as7-dev<https://lists...
>
>
>
>
> ______________________________**_________________
> jboss-as7-dev mailing list
> jboss-as7-dev(a)lists.jboss.org
>
https://lists.jboss.org/**mailman/listinfo/jboss-as7-dev<https://lists...
>
>
--
Jason T. Greene
JBoss AS Lead / EAP Platform Architect
JBoss, a division of Red Hat