コード例 #1
0
  public int update(
      String team,
      String leader,
      String site,
      String server,
      String application,
      String dbms,
      String facebook,
      String google,
      String twitter,
      String googleMap,
      String db,
      String releaseDate,
      String startDateTime,
      String endDateTime,
      String flag,
      String close,
      String biko,
      int id) {
    int result = 0;

    Connection con = DBConnector.getConnection();
    try {
      String sql =
          "update releaseproject set team = ?, leader = ?, site = ?, server = ?, application = ?, dbms = ?, facebook = ?, google = ?, twitter = ?, googleMap = ?, db = ?, releaseDate = ?, startDateTime = ?, endDateTime = ?, flag = ?, close = ?, biko = ? where id = ?";
      PreparedStatement ps = con.prepareStatement(sql);
      ps.setString(1, team);
      ps.setString(2, leader);
      ps.setString(3, site);
      ps.setString(4, server);
      ps.setString(5, application);
      ps.setString(6, dbms);
      ps.setString(7, facebook);
      ps.setString(8, google);
      ps.setString(9, twitter);
      ps.setString(10, googleMap);
      ps.setString(11, db);
      ps.setString(12, releaseDate);
      ps.setString(13, startDateTime);
      ps.setString(14, endDateTime);
      ps.setString(15, flag);
      ps.setString(16, close);
      ps.setString(17, biko);
      ps.setInt(18, id);

      result = ps.executeUpdate();
    } catch (Exception e) {
      e.printStackTrace();

    } finally {
      try {
        con.close();
      } catch (Exception e) {

      }
    }

    return result;
  }
コード例 #2
0
  public int InsertReleaseProject() {
    int result = 0;
    Connection con = DBConnector.getConnection();
    try {
      String sql = "insert into releaseproject values()";
      PreparedStatement ps = con.prepareStatement(sql);
      result = ps.executeUpdate();
    } catch (Exception e) {

    } finally {
      try {
        con.close();
      } catch (Exception e) {

      }
    }

    return result;
  }