Wednesday, May 10, 2006

Back from Vacation

I am back from 1 week Vacation . Yesterday , When I was working on writing JDBC code, i found that returning auto generated keys is supported by JDBC 3.0 . So I went ahead and downloaded the latest ojdbc14.jar and deployed my war in tomcat. Worked without any issues. However, when i deployed the same in 10g AS it gave an abstract method error. Then , when I printed out the driver version property to my utter dismay i found that it was printing 9 and not 10 . After further investigations i found that you need to force 10g AS to use the new jdbc driver.
I went to Java Options for the oc4j instance and added the following as suggested by Oracle forums :
-Xbootclasspath/a:/0gAS home/jdbc/lib/ojdbc14.jar

Then after restarting the oc4j instance, it started working as expected. I am still left wondering though why it did not use the ojdbc14.jar that is in my web-inf/lib directory of the project. Any suggestions/comments are welcome

1 comment:

Robert Willems of Brilman said...

Maybe you should add the files orion-web.xml to your web-inf directory containing the following:

<?xml version = '1.0' encoding = 'windows-1252'?>
<!DOCTYPE orion-web-app PUBLIC "-//Evermind//DTD Orion Web Application 2.3//EN" "">
<orion-web-app servlet-webdir="/servlet/">
<web-app-class-loader search-local-classes-first="true"/>

OC4J (the j2ee container for iAS) then first looks at your web-inf/lib libraries. Else it will prefer it's own libaries.

Other suggestion is: if you configured a datasource then the driver is outside your web application (because the datasource is maintained by the container).