我有一个在插入 oracle 的同时调用 oracle 过程的方法,插入语句有效,但该过程不起作用。我没有收到任何错误。谁能明白为什么这不起作用?
Class.forName("oracle.jdbc.driver.OracleDriver");
String connectionString = "jdbc:oracle:thin:@" + oracle_ip_address + ":" + oracle_db_port + ":" + oracle_db_sid;
Connection conn = DriverManager.getConnection(connectionString, oracle_db_username, oracle_db_password);
ResultSet rs = stmt.executeQuery("Select * from Dropper");
CallableStatement cs = conn.prepareCall("{ call TTMS.job_vacationconflict_notify(?,?,?)}");
SimpleDateFormat sdf = new SimpleDateFormat("dd-MMM-yyyy");
Statement stmt2 = conn.createStatement();
while (rs.next()){
String di = rs.getString("DROPPER_ID");
String sd = rs.getString("BEGIN_DT").replace(" 00:00:00.0", "");
String ed = rs.getString("END_DT").replace(" 00:00:00.0", "");
String vi = rs.getString("VACATION_ID");
String md = rs.getString("MODIFY_DT").replace(" 00:00:00.0", "");
query = "INSERT INTO DROPPER_VACATIONS(DROPPER_ID, BEGIN_DT, END_DT, CREATE_DT, CREATE_BY, MODIFY_DT, MODIFY_BY, COMMENTS, VACATION_ID) "
+ "VALUES ('"+di+"',to_date('"+sd+"','YYYY-MM-DD'),to_date('"+ed+"','YYYY-MM-DD'),sysdate,'MJRUTLED',to_date('"+md+"','YYYY-MM-DD'),'MJRUTLED','','"+vi+"')";
stmt2.executeUpdate(query);
cs.setInt(1,Integer.parseInt(di));
cs.setString(2,sdf.parse(sd).toString());
cs.setString(3,sdf.parse(ed).toString());
cs.execute();
}