PreparedStatement pStmt = this.conn.prepareStatement(insertSubjectSQL);  pStmt.setString(1, subjectType.getName()); pStmt.setString(2, subjectId); pStmt.setString(3, subjectName); pStmt.setString(4, subjectDescription); pStmt.setString(5, subjectDisplayId); pStmt.setDate(6, new Date(new java.util.Date().getTime())); pStmt.executeUpdate();
PreparedStatement pStmt = null; try { pStmt = this.conn.prepareStatement(insertSubjectSQL); pStmt.setString(1, subjectType.getName()); pStmt.setString(2, subjectId); pStmt.setString(3, subjectName); pStmt.setString(4, subjectDescription); pStmt.setString(5, subjectDisplayId); pStmt.setDate(6, new Date(new java.util.Date().getTime())); pStmt.executeUpdate(); } finally { if (pStmt != null) { pStmt.close(); } }
  public Subject newSubject    (SubjectType subjectType,     String subjectId,     String subjectName,     String subjectDescription,     String subjectDisplayId)  throws    SQLException  {    PreparedStatement pStmt      = this.conn.prepareStatement(insertSubjectSQL);      pStmt.setString(1, subjectType.getName());    pStmt.setString(2, subjectId);    pStmt.setString(3, subjectName);    pStmt.setString(4, subjectDescription);    pStmt.setString(5, subjectDisplayId);    pStmt.setDate(6, new Date(new java.util.Date().getTime()));    pStmt.executeUpdate();        Subject subject      = new SubjImpl          (subjectType,           subjectId,           subjectName,           subjectDescription,           subjectDisplayId);    return subject;  }