Solved

java error

Posted on 2007-04-09
3
234 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

623 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