PreparedStatement pStmt = this.conn.prepareStatement(insertTreeNodeSQL);  pStmt.setString(1, tree.getId()); pStmt.setString(2, nodeID); pStmt.setString(3, nodeType); pStmt.setString(4, status.toString()); pStmt.setString(5, name); pStmt.setDate(6, new Date(new java.util.Date().getTime())); pStmt.executeUpdate();
PreparedStatement pStmt = null; try { pStmt = this.conn.prepareStatement(insertTreeNodeSQL); pStmt.setString(1, tree.getId()); pStmt.setString(2, nodeID); pStmt.setString(3, nodeType); pStmt.setString(4, status.toString()); pStmt.setString(5, name); pStmt.setDate(6, new Date(new java.util.Date().getTime())); pStmt.executeUpdate(); } finally { if (pStmt != null) { pStmt.close(); } }
  public TreeNode newTreeNode    (Tree     tree,     String   nodeID,     String   nodeType,     Status   status,     String   name,     TreeNode parent)  throws    SQLException  {    PreparedStatement pStmt      = this.conn.prepareStatement(insertTreeNodeSQL);      pStmt.setString(1, tree.getId());    pStmt.setString(2, nodeID);    pStmt.setString(3, nodeType);    pStmt.setString(4, status.toString());    pStmt.setString(5, name);    pStmt.setDate(6, new Date(new java.util.Date().getTime()));    pStmt.executeUpdate();        TreeNode newNode = new NodeImpl(tree, nodeID, nodeType, status, name);        if (parent == null)    {      tree.addRoot(newNode);    }    else    {      newTreeNodeRelationship(newNode, parent);    }        this.treeNodesAdded++;    return newNode;  }