flashersv
flashersv

Reputation: 11

java.sql.SQLException: [Microsoft][ODBC Driver Manager] (Data source name not found and no default driver specified)

Hola. I have configured my database connection into JNDI in context.xml within "conf" folder in Tomcat:

<Resource name="jdbc/Test1" auth="Container" type="javax.sql.DataSource"
      maxTotal="100" maxIdle="30" maxWaitMillis="10000"
      username="xyz" password="xyz" driverClassName="oracle.jdbc.driver.OracleDriver"
      url="jdbc:oracle:thin:@UNESQUEMA:1431:XYZ"/>

Then in my persistence.xml, I try to use it:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
    <persistence-unit name="Test" transaction-type="RESOURCE_LOCAL">
        <provider>oracle.toplink.essentials.PersistenceProvider</provider>
         <jta-data-source>java:/comp/env/jdbc/Test1</jta-data-source>
        <class>persistence.entity.printers</class>
        <properties>
            <property name="toplink.cache.shared.default" value="false" />
        </properties>
    </persistence-unit>
</persistence>

I also put ojdbc6.jar in my java web project in WebContent>WEB-INF>lib and also put it in "lib" folder in Tomcat.

When I run the project I got error:

javax.servlet.ServletException: #{loginBean.iniciarSesion}: Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0 (Build b40-rc (03/21/2007))): oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

I am using Windows JRE7 (java 1.7)

Thanks for the help

Upvotes: 0

Views: 31

Answers (0)

Related Questions