Oracle 8i and drivers setup

Hi guys, I have a tedious problem, i installed tomcat 3.3.1 server into my solaris unix account, it also has oracle 8i with jdbc drivers, and also jdk1.3 installed. When i start the server and test the examples that came with the tomcat they run fine, but when i try to run my application that calls the register driver and everything as needed, it compiles but then when i start application it says that the oracle.jdbc.driver.OracleDriver class cannot be found. What can be the cause? i used in my classpath the classes111.zip and nls_charsett11.zip into my classpaths... can it be that i cannot use these drivers with jdk1.3? and if so are there any drivers available that i can use with jdk1.3 and oracle 8i ? cause i sure dont think so...

thanks in advance

[775 byte] By [amulla02a] at [2007-9-19]
# 1

by the way, this is my classpath that contains all the stuff...

setenv CLASSPATH /opt/oracle/jdbc/lib/classes111.zip:/opt/oracle/jdbc/lib/nls_charset11.zip:/home/cmanim01/jakarta-tomcat-3.3.1:$CLASSPATH

perhaps i m not using the classpath properly... please point out any flaws... thank you

amulla02a at 2007-7-8 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 2

Hello,

I can't exactly remember how it works with the older 3.x series Tomcat, but with 4.x JDBC drivers are not in the classpath, but in the

$TOMCAT_HOME/common/lib

directory.

I think you might be able to fix it by moving the drivers to the web applications WEB-INF/lib directory.

Cheers,

Kare

karea at 2007-7-8 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 3

yeah i moved the jar libraries into tomcathome/webapps/ROOT/WEB-INF/lib and now it doesnt give me any errors about locating the driver class however it doesnt seem to be interacting with the database... very weird... i ll continue trying to debug it... but i can use the oracle classes111.zip files with jdk1.3 right? cause in documentation it says use with jdk1.1 something like that...

amulla02a at 2007-7-8 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 4
ihad this problem and done this :try to put the jdbc****.jar file into the $CATALINA_HOME/common/lib and put this in the $CLASSPATH ......i expect it works ..... =] luck !!!!!!!!!!!!!!!!!!!!
parasitowsa at 2007-7-8 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 5

Try see the catalina.sh. This file maybe change your class path:

# -- Set Up The System Classpath -

CP="$CATALINA_HOME/bin/bootstrap.jar"

if [ -f "$JAVA_HOME/lib/tools.jar" ] ; then

CP=$CP:"$JAVA_HOME/lib/tools.jar"

fi

if [ -f "$JSSE_HOME/lib/jsse.jar" ] ; then

CP=$CP:"$JSSE_HOME/lib/jcert.jar":"$JSSE_HOME/lib/jnet.jar":"$JSSE_HOME/lib/jsse.jar"

fi

joaoluizMa at 2007-7-8 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 6
whats that catalina_home variable? tomcat home? cause i dont see anywhere in my tomcat home common directory... i only have it at /tomHome/lib/common
amulla02a at 2007-7-8 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 7
Sorry. I use TomCat 4.0. Verify, in TomCat 3.x the tomcat_home. The file catalina.sh is locate in $TOMCAT_HOME/bin.
joaoluizMa at 2007-7-8 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 8
nope i dont see catalina in /bin dir
amulla02a at 2007-7-8 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 9
Try file tomcat.sh.
joaoluizMa at 2007-7-8 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 10

yeah i see tomcat.sh in /bin dir, but what am i suppose to do to start quering the oracle 8i database? i already set the paths for 2 zip files of oracle drivers, then i put jar version of those 2 inside /webapps/ROOT/WEB-INF/lib/ directory. The examples of jsps work fine, but when i write my application that quieries DB it doesnt seem to be interacting at all. I use tomcat 3.3.1, jdk1.3, and the classes111.zip and nls_charset11.zip...

also all my jsps are at webapps/ROOT/ directory, thats why i put the jdbc jar files inside webapps/ROOT/WEB-INF/lib

hmmm i m clueless at why its not doing anything...

amulla02a at 2007-7-8 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 11
ok i added these guys classes111.jar and nls_charset11.jar to the tomcat.sh but still no go...CLASSPATH=${TOMCAT_INSTALL}/lib/tomcat.jar:${TOMCAT_INSTALL}/lib/classes111.jar
amulla02a at 2007-7-8 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 12
You need to use ';' (semicolon) as the separator for classpath entries. But, you are using : (colon), that will certainly cause problems. Try again by changing it.Hope this helps.Sudha
sudha_mpa at 2007-7-8 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 13

Hi

First i will answer your question whether you can use classes111.zip for jdk1.3 or not? Actually classes111.zip is for jdk1.x versions and for jdk1.2 and above its classes12.zip. Still you can use classes111.zip but it will not work for new topics.

For checking whether the classpath for classes12.zip is set on your machine, include the following statement in your code

import oracle.jdbc.driver.OracleDriver;

and compile the programe, if it compiles successfully nothing but classpath is set, else its not set properly. The classpath can be set as follows.

set CLASSPATH="$CLASSPATH:/usr/local/classes/classes12.zip"

NOTE: Remember to use : as the delimeter on all unix and solaris OS. If it is windows then use ; as the delimeter.

You can also check your classpath by typing echo $CLASSPATH at the console.

Once you confirm that the classpath is set, run the file from tomcat. Still if you get the error saying driver not found then include the classpath in $TOMCAT_HOME/bin/tomcat.sh file. For checking classpath in tomcat, run snoop.jsp or snoop servlet, which comes with default examples in any servlet engine.

Hope this will solve your problem. All the best.

Sridhar

sridharsarmaa at 2007-7-8 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 14
hmm i see thanx, actually i solved the problem i had because i figured out the adminostrator gave me the wrong service id... go figure...also thanks for pointing out the semicolon, i still havent tried running it, but test app works but not with tomcat...
amulla02a at 2007-7-8 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 15
Glad you got it working, but as suggested above, you might want to encourage the admin to upgrade to classes12!
thomasflya at 2007-7-18 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 16

yeah i used classes12.jar files instead of 111... by the way, its the damnest thing about oracle, it has auto commit to false? like when i access the oracle via jsps it updates the table, but when i exit the session the tables take on the original value... isnt in java its autocommit(true) unless u specify otherwise? very puzzling

amulla02a at 2007-7-18 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 17
Auto commit is set by the database. The java.sql.Connection interface has a method, getAutoCommit() that returns a boolean which you can use to determine if it's on or off and explicitly put in a COMMIT line if it's off.
edward_brode1a at 2007-7-18 > top of java,Enterprise & Remote Computing,Web Tier APIs...