java.lang.ClassNotFoundException
当我执行以下代码时,我得到一个。有人可以解释我为什么要面对这个吗?我需要做的就是连接到数据库并从中获取一些值。我使用的eclipse有问题吗?
import java.sql.*;
public class test_sample {
public static void main(String[] args) {
try {
System.out.println("Test1");
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Class.forName("oracle.jdbc.OracleDriver");
System.out.println("Test2");
Connection con = DriverManager.getConnection(
"jdbc:oracle:thin:@ussbazudb126.ussb.winson.net:1521/epdev", "manager", "<<PASSWORD>>");
System.out.println("Test3");
// Statement st = con.createStatement();
PreparedStatement meta = con.prepareStatement("select project from isac_extract");
System.out.println("Test4");
ResultSet rset = meta.executeQuery();
while (rset.next()) {
String project = rset.getString(1);
System.out.println(project);}
}
catch (Exception e){
e.printStackTrace();
}
finally {System.out.println("Final Block");}
}
}