try{
    Class.forName("oracle.jdbc.driver.OracleDriver");
  } catch(java.lang.ClassNotFoundException e){
     out.print("<br>Error:"+e.getMessage());
  }
  
 // try{
   String url="jdbc:oracle:thin:@192.168.0.2:1521:webdb";
   Connection conn = DriverManager.getConnection(url,"duwucn","abcde");
   Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE); 
 // } catch(SQLException e){
    //out.print("<br>statement:"+e.toString());
 // }
上面的是连oracle的代码,希望对你有帮助