0
votes

I am trying to connect to oracle database using os authentication through jdbc.

I have oracle 10g installed on solaris sparc 32 bit.

Following is the code for jdbc connection :-

String url = "jdbc:oracle:thin:@oracleserver.mydomain.com:5521:dbja"

Driver driver = new oracle.jdbc.OracleDriver();

DriverManager.registerDriver(driver);

Properties props = new Properties();

props.setProperty(OracleConnection.CONNECTION_PROPERTY_THIN_VSESSION_OSUSER,"oracle");

Connection conn = DriverManager.getConnection( url, props);

when i run the above code using thin driver, it gives error as "invalid username/password ; logon denied'

using oci driver error is :: "no ocijdbc11 in java.library.path" but i am using oracle 10g and in LD_LIBRARAY_PATH libocijdbc10.so is present. but still looking for libocijdbc11.so.

Please help me to resolve the issue.

Thanks

1

1 Answers

0
votes

For using os authentication, please check the oracle documentation

  • How is the os_authent_prefix?
  • Does the user oracle exist?
  • Is REMOTE_OS_AUTHENT = TRUE?

For OCI access, the relevant thing here is the JDBC driver, which must match the oracle client version. To achieve this, add the 10g jdbc driver from your oracle client installation to the class path.