java.lang.ClassNotFoundException:oracle.jdbc.driver.OracleDr
iver? I get this error at run time.I used oracle10G. I set
CLASS PATH:C:\oraclexe\app\oracle\product\10.2.0
\server\jdbc\lib\ojdbc14.jar;
I write JDBC PROGRAM like
import java.sql.*;
class Example
{
public static void main(String args[])
{
try
{
Class.forName
("oracle.jdbc.driver.OracleDriver");
System.out.println("Driver Loaded");
Connection con=DriverManager.getConnection
("jdbc:oracle:thin:@localhost:1521:xe","system","salmas");
System.out.println("Driver Connected");
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select * from
emp");
while(rs.next())
{
System.out.println(rs.getInt(1));
System.out.println(rs.getString(2));
System.out.println(rs.getString(3));
}
st.close();
con.close();
}
catch(Exception e)
{
System.out.println(e);
}
finally
{
System.out.println("it's
finally block executed");
}
}
}
Answer Posted / vishnu
iam usin type 4 driver .using oracle 10g.when i am trying to run the code error came like this Exception in thread "main" java.lang.ClassNotFoundException: oracle.jdbc.
OracleDriver.
| Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
How do we call a stored procedure from jdbc?
What are the utilities of the callablestatement?
Is jdbc object oriented?
Briefly tell about the jdbc architecture.
Jdbc-odbc bridge is multi-threaded or not?
Can resultset be null in java?
What is jdbc connection string?
Define preparedstatement.
password, is stored in as plain text. What can I do to protect my passwords?
How can I connect mysql or oracle with java?
Give a way to check that all result sets have bin accessed and update counts are generated by execute method.
Why do we need jdbc driver?
What are the common jdbc exceptions?
What is jdbc architecture in java?
Is jdbc faster than odbc?