2 Replies Latest reply on Jun 18, 2003 10:24 PM by jerry18

    JDBC datasource & JNDI

    jerry18

      In my application, the JDBC datasource is "jdbc/tutorial". And it runs okay with Websphere. With JBoss, I set the oracle-ds.xml like this:


      <local-tx-datasource>
      <jndi-name>jdbc/tutorial</jndi-name>
      <connection-url>jdbc:oracle:thin:@localhost:1521:tutorial</connection-url>
      <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
      <user-name>demo</user-name>
      password
      <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
      </local-tx-datasource>



      Also I put the classes12.zip into the lib directory. However, when I run this application. The database access results such error:
      javax.naming.NameNotFoundException: jdbc not bound

      What's wrong?

        • 1. Re: JDBC datasource & JNDI
          jerry18

          Woo, I found the solution. In my application, I should add the prefix java:/ to JNDI. But another error raised.


          java.sql.SQLException: ORA-01017: invalid username/password; logon denied


          In the oracle-ds.xml,


          <user-name>demo</user-name>
          password

          I can use this username/password to logon in SQL/Plus. What's the problem?

          • 2. Re: JDBC datasource & JNDI
            jerry18

            Yeah, it's my mistake. I misspelled the password. So sorry.