sql1="delete from abc1";
ssq2="delete from abd2";
statement.execute(sql1);
statement.execute(sql2);
只能分两次执行
mysql现在还不支持储存过程

解决方案 »

  1.   

    Statement.addBatch(),执行批量查询
      

  2.   

    con.setAutoCommit(false);
    Statement stmt = con.createStatement();
    stmt.addBatch("INSERT INTO employees VALUES (1000, 'Joe Jones')");
    stmt.addBatch("INSERT INTO departments VALUES (260, 'Shoe')");
    stmt.addBatch("INSERT INTO emp_dept VALUES (1000, 260)");
    // submit a batch of update commands for execution
    int[] updateCounts = stmt.executeBatch();