file1.jpg
i have problem in this exception i code exception error
with type -4
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
file1.jpg
i have problem in this exception i code exception error
with type -4
import java.sql.*;
public class SelectTest
{
public static void main(String [] args) throws Exception
{
try
{
//register driver and establish the connection
Class.forName("oracle .jdbc.driver.OracleDriver");
Connection con =DriverManager.getConnection("jdbcracle:thin:@localhost:1521:ORCL.REGRESS.RDMS.DEV.U S.ORACLE.COM","scott","tiger");
//create statement object
Statement st =con.createStatement();
//send and execute query
ResultSet rs =st.executeQuery("select * from student;");
// precess the result object
while(rs.next())
{
System.out.println(rs.getInt("sno")+" "+rs.getString("sname")+" " +rs.getString("marks"));
}
//close jdbc objects
rs.close();
st.close();
con.close();
}
catch (SQLException e)
{
e.printStackTrace();
}
}//main()
}//class
error message above code please find to us
For future reference, please copy and paste all error message directly to the forums, as well as wrap your code in the code tags.
Based upon the image, you've got a ClassNotFoundException, in which case you need to add the appropriate Driver of your database to the classpath