PreparedStatement pStmt = this.conn.prepareStatement(insertAttrSQL);  pStmt.setString(1, subject.getType().getName()); pStmt.setString(2, subject.getId()); pStmt.setString(3, name); pStmt.setInt(4, instance); pStmt.setString(5, value); pStmt.setString(6, searchValue); pStmt.setDate(7, new Date(new java.util.Date().getTime())); pStmt.executeUpdate();
PreparedStatement pStmt = null; try { pStmt = this.conn.prepareStatement(insertAttrSQL); pStmt.setString(1, subject.getType().getName()); pStmt.setString(2, subject.getId()); pStmt.setString(3, name); pStmt.setInt(4, instance); pStmt.setString(5, value); pStmt.setString(6, searchValue); pStmt.setDate(7, new Date(new java.util.Date().getTime())); pStmt.executeUpdate(); } finally { if (pStmt != null) { pStmt.close(); } }
  public void newAttribute    (Subject subject,     String name,     int    instance,     String value,     String searchValue)  throws    SQLException  {    PreparedStatement pStmt      = this.conn.prepareStatement(insertAttrSQL);      pStmt.setString(1, subject.getType().getName());    pStmt.setString(2, subject.getId());    pStmt.setString(3, name);    pStmt.setInt(4, instance);    pStmt.setString(5, value);    pStmt.setString(6, searchValue);    pStmt.setDate(7, new Date(new java.util.Date().getTime()));    pStmt.executeUpdate();        ((SubjImpl)subject).addAttribute(name, value);  }