[jboss-user] persistence.xml and datasource

Jari Fredriksson jarif at iki.fi
Sat Dec 6 08:13:02 EST 2008


> Hello!
> 
> Jboss likes to name jdbc-datasources like java://DefaultDS
> 
> I would like to use name like jdbc/MyDatasource in my
> persistence.xml 
> 
> That is so the definition would be portable across
> application servers out there. I'm sure there must a
> simple way to declare and alias for persistence.xml use,
> but have not found out it yet.   
> 
> Any ideas?
> 

I fgured it out, a JBoss4 feature

<datasources>
  <local-tx-datasource>
    <jndi-name>jdbc/Distal</jndi-name>
    <use-java-context>false</use-java-context>
    <connection-url>jdbc:mysql://dbsrv:3306/distal3</connection-url>


use-java-context

Wonder why no-one knew this, I came to jboss-user for the expertice;)





More information about the jboss-user mailing list