连接数据库所的一段:
public void connectDB()
{
//this is the database driver
String DBdriver = "oracle.jdbc.driver.OracleDriver";
//this is the url of the database
String url = "jdbc

racle:xxxxxxxxxx";
//initial connection and statement of database
Statement stmt = null;
Connection conn = null;
//load the database driver
try
{
Class.forName(DBdriver);
}catch(Exception e)
{
System.out.println("Can not load the database driver");
System.out.println(e);
}
//set up connection
try
{
conn = DriverManager.getConnection(url,"xxx","xxx");
stmt = conn.createStatement();
}catch(SQLException sqle)
{
System.out.println("Can not connect to the database");
System.out.println(sqle);
}
}
然后它说错误是:
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
为什么呢????