try {
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
con =DriverManager.getConnection("jdbc:oracle:thin:@172.16.127.111:1521:ora9",
DB_USER, DB_PASS);
result = true ;
} catch (ClassNotFoundException cnfe) {
System.out.println("Not Found Oracle Driver:"+cnfe) ;
} catch (Exception e) {
System.out.println("connect Oracle has error:"+e) ;
try{
Thread.sleep(5000) ;
} catch(Exception ees){}
调用此方法就可以连接任何服务器的数据库,只要网络允许
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
con =DriverManager.getConnection("jdbc:oracle:thin:@172.16.127.111:1521:ora9",
DB_USER, DB_PASS);
result = true ;
} catch (ClassNotFoundException cnfe) {
System.out.println("Not Found Oracle Driver:"+cnfe) ;
} catch (Exception e) {
System.out.println("connect Oracle has error:"+e) ;
try{
Thread.sleep(5000) ;
} catch(Exception ees){}
调用此方法就可以连接任何服务器的数据库,只要网络允许
配置以上信息后,请重新启动JB,以使你的设置有效。然后在用楼上的代码