[jboss-dev-forums] [JBoss AS 7 Development] - Re: Datasource configuration from Tomcat

Julien Pardons do-not-reply at jboss.com
Mon Sep 17 06:17:45 EDT 2012


Julien Pardons [https://community.jboss.org/people/jpardons] created the discussion

"Re: Datasource configuration from Tomcat"

To view the discussion, visit: https://community.jboss.org/message/759845#759845

--------------------------------------------------------------
I tried with this name, but I got the same error.

I made a full search on my code, here is the results:

String jndiName = getProperties().getProperty("jndi.datasource.name", "java:comp/env/jdbc/EPCISDB");

jndi.datasource.name=java:comp/env/jdbc/EPCISDB

<hibernate-configuration>
  <session-factory>
    <property name="hibernate.connection.datasource">java:comp/env/jdbc/EPCISDB</property>

<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean" scope="singleton">
    <property name="jndiName" value="jdbc/EPCISDB" />
    <property name="resourceRef" value="true" />
  </bean>

<Resource
    name="jdbc/EPCISDB"
    type="javax.sql.DataSource"
    auth="Container"
    username="${db.username}"
    password="${db.password}"
    driverClassName="com.mysql.jdbc.Driver"
    defaultAutoCommit="false"
    url="jdbc:mysql://localhost:3306/${db.database}?autoReconnect=true">
  </Resource>

<resource-ref>
    <res-ref-name>jdbc/EPCISDB</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
  </resource-ref>
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/759845#759845]

Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2225]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20120917/9e2f9f74/attachment.html 


More information about the jboss-dev-forums mailing list