LinuxÒÁµéÔ°ÂÛ̳'s Archiver

tiffany1984 ·¢±íÓÚ 2005-2-1 19:26

ÇóÖú£¡£¡Ë­À´°ïÎÒ¿´Ò»ÏÂÕâ¸öС³ÌÐò¡£¡£

Á¬½ÓÊý¾Ý¿âËùµÄÒ»¶Î:

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]

tiffany1984 ·¢±íÓÚ 2005-2-1 19:34

ºÇºÇ£¬ÎÒÖªµÀÁË£¬ÍüÁ˼ÓÈëoracleµÄlibrary.........ÍÚ¹þ¹þ£¬Õ汿

tiffany1984 ·¢±íÓÚ 2005-2-1 19:38

[b]À²À²À²~~~~[/b]

Ò³: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.