コード例 #1
0
  public void updateGroup(Connection c, Group g) throws AdminException {
    PreparedStatement statement = null;
    String theQuery =
        "update "
            + drvSettings.getGroupTableName()
            + " set "
            + drvSettings.getGroupNameColumnName()
            + " = ?,"
            + drvSettings.getGroupDescriptionColumnName()
            + " = ?"
            + " where "
            + drvSettings.getGroupSpecificIdColumnName()
            + " = ?";

    try {
      SilverTrace.debug("admin", "SQLGroupTable.updateGroup", "root.MSG_QUERY", theQuery);
      statement = c.prepareStatement(theQuery);
      statement.setString(1, drvSettings.trunc(g.getName(), 100));
      statement.setString(2, drvSettings.trunc(g.getDescription(), 400));
      statement.setInt(3, Integer.parseInt(g.getSpecificId()));
      statement.executeUpdate();
    } catch (Exception e) {
      throw new AdminException(
          "SQLGroupTable.updateGroup",
          SilverpeasException.ERROR,
          "root.EX_SQL_QUERY_FAILED",
          "Query = " + theQuery,
          e);
    } finally {
      DBUtil.close(statement);
    }
  }
コード例 #2
0
 protected String getColumns() {
   return drvSettings.getGroupSpecificIdColumnName()
       + ", "
       + drvSettings.getGroupParentIdColumnName()
       + ", "
       + drvSettings.getGroupNameColumnName()
       + ", "
       + drvSettings.getGroupDescriptionColumnName();
 }