ÇóÖú£¡£¡ËÀ´°ïÎÒ¿´Ò»ÏÂÕâ¸öС³ÌÐò¡£¡£
Á¬½ÓÊý¾Ý¿âËùµÄÒ»¶Î:public void connectDB()
{
//this is the database driver
String DBdriver = "oracle.jdbc.driver.OracleDriver";
//this is the url of the database
String url = "jdbc:oracle: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);
}
}
È»ºóËü˵´íÎóÊÇ:
[size=2][color=#0000ff]java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
ÎªÊ²Ã´ÄØ????
[/color][/size] ºÇºÇ£¬ÎÒÖªµÀÁË£¬ÍüÁ˼ÓÈëoracleµÄlibrary.........ÍÚ¹þ¹þ£¬Õ汿 [b]À²À²À²~~~~[/b]
Ò³:
[1]