Solved

java error

Posted on 2007-04-09
3
231 Views
Last Modified: 2010-03-31
I have the follwing error

C:\classes>javac -classpath . com\psol\xbe2\MySAXApp2.java
com\psol\xbe2\MySAXApp2.java:11: package oracle.jdbc does not exist
import oracle.jdbc.OraclePreparedStatement;
                   ^
com\psol\xbe2\MySAXApp2.java:57: cannot resolve symbol
symbol  : class OraclePreparedStatement
location: class com.psol.xbe2.MySAXApp2
     OraclePreparedStatement pstmt = null;
     ^
2 errors
my java code heder:

package com.psol.xbe2;

// Java SQL imports.
import java.io.*;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;

// Oracle JDBC imports.
import oracle.jdbc.OraclePreparedStatement;
0
Comment
Question by:fm134
3 Comments
 
LVL 10

Accepted Solution

by:
Jaax earned 400 total points
ID: 18875223
You need to specify classes12.jar in your classpath
javac -classpath .;PathOfClasses12\classes12.jar  com\psol\xbe2\MySAXApp2.java
0
 
LVL 8

Assisted Solution

by:mnrz
mnrz earned 100 total points
ID: 18875224
You should place the jar file contains the oracle.jdbc.OraclePreparedStatement and other classes in the class path.

please tell us in which directory you run that command and where is the oracle's jar file
0
 

Author Comment

by:fm134
ID: 18877097
hi jaxx
thanks but the command was too long
C:\classes>javac -classpath C:\oracle\product\10.1.0\db_1\jdbc\lib\classes12.jar
 com\psol\xbe2\MySAXApp2.java

hi mnrz
I tried to move classes12.jar to same  path com\psol\xbe but did not work!!
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
eclipse java  build path 6 59
Spring Framework HTTPSession management 1 36
more than one jdk and one jre 1 44
hibernate jars 4 33
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question