PreparedStatement
을 여러 문장으로 사용할 수 있습니까?여러 문에 대한 PreparedStatement
예컨대, 내 말은 String sql = "INSERT INTO OR INGNORE ... ; UPDATE ... ; INSERT INTO ...";
이
PreparedStatement pre = conn.prepareStatement(sql);
//...
pre.executeUpdate();
이 (세미콜론까지)에만 첫 번째 문 "INSERT INTO OR INGNORE ...
을 실행하는 경우. 한 번에 모두 실행할 수 있습니까?
당신이 찾고있는 것은 일괄 처리입니다. 당신은 배치에있는 모든 문장을 삽입 한 다음 배치를 실행 – XtremeBaumer
mysql 특정 솔루션이 있습니다 : http://stackoverflow.com/questions/10797794/multiple-queries-executed-in-java-in-single-statement – Vladimir