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