Skip to Main Content

Java and JavaScript in the Database

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Oracle server side jdbc thin driver throws ORA-01017

742048Mar 6 2011 — edited Mar 30 2011
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

Comments

Steve.Clamage-Oracle

This question really belongs in the Solaris Studio C/C++/Fortran Compilers forum:

https://community.oracle.com/community/server_%26_storage_systems/systems-development-and-management-tools/application_d…

You don't show how you are building your program, and you don't say which version of Studio you are using, or the platform you are using. All of this data is important to understand your issue.

You are mixing binary code created by the Studio C++ compiler with code built with g++. That will work only under these conditions:

- You must use the -compat=g option with Studio C++ on every CC command, compiling and linking. (If  you are using Studio 12.4, you can use -std=c++03 or -std=c++11 instead.)

- The g++ compiler must be compatible with the version expected by the Studio C++ compiler, which depends on the Studio version.

- Only shared libraries (.so files) created by g++ can be linked, not .o or .a files.

- The compiler (CC or g++)  that builds the main program must be used to link the final program.

If you meet all these conditions and the code still fails, please show

- the Studio version (run the command "CC -V"),

- the g++ version (run "g++ -v"),

- the platform (operating system and version, and whether it is Sparc or x86), and

- show how you build the program.

1 - 1
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Apr 27 2011
Added on Mar 6 2011
4 comments
42,832 views