日期:2014-05-17 浏览次数:21327 次
Connection conn1 = null;
//getDbConnection db1 = new getDbConnection();
//Connection conn1 = db1.getConn();
try {
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
while(true){
conn1 = DriverManager.getConnection("jdbc:oracle:thin:@132.232.36.137:1521:manage", "server","server");
if(conn1!=null){
// System.out.println("异常数据没有导入成功:"+info.getDEST_NUM()+"------------------------------------------------------");
break;
}
}
/* DriverManager.setLoginTimeout(600);
conn1 = DriverManager.getConnection("jdbc:oracle:thin:@132.232.33.133:1521:manage1", "server1","server1");
*/
PreparedStatement ps = conn1.prepareStatement(sql);
result = 0;
失败就是执行了一部分数据后,然后报数据连接失败,然后写库就终止了,不在继续执行。难道非得一次性写入才可以?我想知道为什么上边的死循环都可以跳出来呢。
while(true){
conn1 = DriverManager.getConnection("jdbc:oracle:thin:@132.232.36.137:1521:manage", "server","server");
if(conn1!=null){
// System.out.println("异常数据没有导入成功:"+info.getDEST_NUM()+"------------------------------------------------------");