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?
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:
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.