Thanks!<br><br>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 <br>
<br>I solve it by wrapping the driver in my own class and register the driver to the DriverManager<br>
<br>Like this :<br> DriverManager.registerDriver(new DatabaseDriverWrapper(driver));<br> DriverManager.getConnection(url, user, password);<br><br><div class="gmail_quote">2012/7/23 Tomaž Cerar <span dir="ltr"><<a href="mailto:tomaz.cerar@gmail.com" target="_blank">tomaz.cerar@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br><br><div class="gmail_quote"><div><div>On Mon, Jul 23, 2012 at 5:58 PM, Jason T. Greene <span dir="ltr"><<a href="mailto:jason.greene@redhat.com" target="_blank">jason.greene@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>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 schema with an<br>
>> extra attribute "module" and then user need pack his JDBC driver as module.<br>
>><br>
>> I use the code below to load the model and the driver class.<br>
>><br>
>> Class<?> driverClass =<br>
>> Module.loadClassFromCallerModuleLoader(ModuleIdentifier.fromString(moduleName),<br>
>> driver);<br>
>> driverClass.newInstance();<br>
>><br>
>> <outbound-connections><br>
>> <database><br>
>> <connection module="com.h2database.h2"<br>
>> driver="org.h2.jdbcx.JdbcDataSource" name="db"<br>
>> url="jdbc:h2:/tmp/test;DB_CLOSE_DELAY=-1" username="sa" 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 <driver> tag, so<br>
> this would be similar.<br>
><br>
> Things to watch out for is of course the password attribute - it should<br>
> at least support the vault mechanism I would say.<br>
<br>
</div>If you make the attribute definition have expressions=true, it will<br>
automatically enable vault support.<br>
<div><br></div></blockquote></div></div><div>given that you use AD.parseAndSetParameter() when parsing and setting field and AD.resolveModelAttribute() when getting data from model<br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
--<br>
Jason T. Greene<br>
JBoss AS Lead / EAP Platform Architect<br>
JBoss, a division of Red Hat<br>
</div><div><div>_______________________________________________<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/mailman/listinfo/jboss-as7-dev</a><br>
</div></div></blockquote></div></div><br>
<br>_______________________________________________<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/mailman/listinfo/jboss-as7-dev</a><br>
<br></blockquote></div><br>