4 Replies Latest reply: Mar 30, 2011 3:23 AM by 742048 RSS

    Oracle server side jdbc thin driver throws ORA-01017

    742048
      We upgraded our database to 11.2.0.1 from 9.2.0.6.

      When we try to connect to an external database from Oracle JVM using server side jdbc thin driver, it throws invalid user id/password error.

      The below test code simulates the issue and is not working on the upgraded instance. The same code is working in fine in other 11.2.0.1 instances. It worked fine before upgrade. In all cases, we are connecting to the same target database instance which is also in 11.2.0.1. It fails only on this database.

      SEC_CASE_SENSITIVE_LOGON is set to false.

      Any inputs will be highly appreciated.

      Code:_
       
      create or replace and compile java source named TestConn as 
      import java.sql.SQLException; 
      import oracle.jdbc.OracleDriver; 
      import oracle.jdbc.OracleConnection; 
      import java.sql.DriverManager; 
      
           
      public class TestConn { 
      
           public  static String runTest() { 
            
            String msg = "Start"; 
            
            OracleConnection tempOC = null; 
            
            try { 
            
            String pUrl = "jdbc:oracle:thin:@dev:1521:dev"; 
            String pUser = "tst_user"; 
            String pPwd = "dummy"; 
      
            DriverManager.registerDriver (new oracle.jdbc.OracleDriver()); 
            tempOC = (OracleConnection)DriverManager.getConnection(pUrl, pUser, pPwd); 
      
      
      msg = "Success"; 
      
      } catch (SQLException sqle) { 
      
            System.out.println(sqle.toString()); 
            sqle.printStackTrace(); 
            msg = "Failure"; 
             
           } 
               
              return msg; 
                 
           } 
      }   
      / 
      
      CREATE OR REPLACE FUNCTION test_conn RETURN VARCHAR2 
      AS LANGUAGE JAVA 
      NAME 'TestConn.runTest() return java.lang.String'; 
      / 
      
      
      set serverout on 
      declare 
      c varchar2(4000); 
      begin 
      dbms_java.set_output(5000); 
      c:=test_conn(); 
      dbms_output.put_line(c); 
      end; 
      / 
      Error Message_
       
      
      java.sql.SQLException: ORA-01017: invalid username/password; logon denied 
      java.sql.SQLException: ORA-01017: invalid username/password; logon denied 
             at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:439) 
             at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:388) 
             at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:381) 
             at oracle.jdbc.driver.T4CTTIfun.processError(T4CTTIfun.java:564) 
             at oracle.jdbc.driver.T4CTTIoauthenticate.processError(T4CTTIoauthenticate.java:431) 
             at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:436) 
             at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186) 
             at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:366) 
             at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java) 
             at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:359) 
             at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java) 
             at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:221) 
             at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32) 
             at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java) 
             at java.sql.DriverManager.getConnection(DriverManager.java) 
             at java.sql.DriverManager.getConnection(DriverManager.java) 
             at TestConn.runTest(TESTCONN:22) 
      Edited by: sskumar on Mar 6, 2011 1:12 PM