PreparedStatementCallback PreparedStatement回调接口定义

jt.execute("update owners set address = 'GuangZhou' where telephone = ?",
    new PreparedStatementCallback(){
     public Object doInPreparedStatement(PreparedStatement ps) throws SQLException, DataAccessException {
      ps.setString(1, "16068008");
      ps.addBatch();
      ps.setString(1, "6085555487");
      ps.addBatch();
      return ps.executeBatch();
     }
  });

你可能感兴趣的:(java,数据库)