Can OS authentication be done for connecting to Oracle database from a java application built on JDK 1.4?

194 views Asked by At

I have a java application which connects to Oracle database, but I want the application to use OS authentication instead of providing the credentials of the database user through the program. I was able to implement it in a JAVA application which was built using JDK 1.6 by using jdbc driver package ojdbc5.jar instead of classes12.jar (which I was using earlier). I did that because I read somewhere that classes12.jar doesn't support OS authentication. Everything worked fine for this application, but when I tried to implement the same in a JAVA application built on JDK 1.4, I was getting errors while compiling the code by using ojdbc5.jar

How can I implement OS authentication on apps built on JDK 1.4?

1

There are 1 answers

0
Guntram Blohm On

You can't (And even if you could, it wouldn't be a good idea, since any user could impersonate another user using -Djava.user=someoneelse on the command line).

From the Oracle Docs:

In 11g release 2 (11.2), both the JDBC OCI and thin drivers support all the Oracle Advanced Security features. Earlier releases of the JDBC drivers did not support some of the ASO features.

ojdbc5.jar is for java 1.5, ojdbc6.jar is for java 1.6, and the older classes12.jar, which will work with java 1.4, stopped being supported with Oracle 10.

You might try the newest Oracle 10 driver, (try ojdbc14.jar), but even if it works, it's not really a good idea because it's just not secure.