/** * Adds a feature to the Account attribute of the ProjectUtils class * * @param db The feature to be added to the Account attribute * @param projectId The feature to be added to the Account attribute * @param orgId The feature to be added to the Account attribute * @throws SQLException Description of the Exception */ public static synchronized void addAccount(Connection db, int projectId, int orgId) throws SQLException { OrganizationList organizationList = new OrganizationList(); organizationList.setProjectId(projectId); organizationList.setOrgId(orgId); organizationList.buildList(db); if (organizationList.size() == 0) { int i = 0; int seqId = DatabaseUtils.getNextSeq(db, "project_accounts_id_seq"); PreparedStatement pst = db.prepareStatement( "INSERT INTO project_accounts " + "(" + (seqId > -1 ? "id, " : "") + "project_id, org_id) " + "VALUES (" + (seqId > -1 ? "?, " : "") + "?, ?) "); if (seqId > -1) { pst.setInt(++i, seqId); } pst.setInt(++i, projectId); pst.setInt(++i, orgId); pst.execute(); pst.close(); } }