Link to home
Start Free TrialLog in
Avatar of aman0711
aman0711

asked on

Error with ojdbc14.jar in java application

Hi experts,
                  I have a java program that parses XML input. This code connects with the DB and fetchs some data. Our database is placed on a UNIX box.
                  Now whenever We are trying to compile the program, we are getting the following error:
           Import oracle.jdbc.driver.*;
   
           We even tried to put the new ojdbc14.jar.. but still no success.
InputXmlCreate.java:17: package oracle.jdbc.driver does not exist
import oracle.jdbc.driver.*;
^
InputXmlCreate.java:43: cannot find symbol
symbol : variable OracleTypes
location: class met.InputXmlCreate
cStmt.registerOutParameter(1, OracleTypes.CURSOR);
^
InputXmlCreate.java:46: cannot find symbol
symbol : class OracleCallableStatement
location: class met.InputXmlCreate
cursor = ((OracleCallableStatement)cStmt).getCursor(1);
^
Note: InputXmlCreate.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

Open in new window

Avatar of Jim Cakalic
Jim Cakalic
Flag of United States of America image

Are you sure that the jar is in the classpath? What driver version do you have? The oracle.jdbc.driver package is deprecated and planned to be removed but I didn't think that was until v12.
Avatar of aman0711
aman0711

ASKER

Hello Sir,
                 I tried downloading the latest ojdbc14.jar. if the package is deprecated then whats the other to fix this problem?
ASKER CERTIFIED SOLUTION
Avatar of Jim Cakalic
Jim Cakalic
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I will try it right now :-) and get back to you with results.
Hello Sir,
                 I tried that but still the same error. its actually giving error on these statements as well:
             cStmt.registerOutParameter(1, OracleTypes.CURSOR)
 
right under OracleTypes


where have you put the jar file?

Hi Objects,
                    Earlier we had it in a seperate folder. on our unix box we have the following structure at root level:
 
                   Root-
                              Ext (ojdbc.jar)
                              Prod (java code)
                              We tried to put the jar file in Prod folder as well but still no change.
 
 
OK. So you fixed all your imports that were oracle.jdbc.driver to just oracle.jdbc. What error are you getting now? Any chance you can attach the code (or file)?
I suggested initially that the jar may not be referenced in the classpath. Did you check that?
how are you compiling, and how is the compile finding the jar?

@ Objects,
                       javac -d . InpCreate.java
                       even gave the complete class path as well
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@ Objects,
                      Can you please provide me a sample code how to include that,, if we consider that jar file is in folder ext
If you are compiling in the Prod folder then:
javac -classpath=../Ext/ojdbc14.jar -d .  inpCreate.java
Oops at last it worked.
we were specifying the jar file path but without " :. " at the end.... added " :. " this time and worked fine :)
OOPS! Sorry. No '=' in that!
javac -classpath ../Ext/ojdbc14.jar -d .  inpCreate.java