Search in sources :

Example 1 with CaHasProfiles

use of org.xipki.ca.dbtool.jaxb.ca.CAConfigurationType.CaHasProfiles in project xipki by xipki.

the class CaConfigurationDbExporter method exportCaHasProfile.

// method exportScep
private void exportCaHasProfile(CAConfigurationType caconf) throws DataAccessException {
    System.out.println("exporting table CA_HAS_PROFILE");
    CaHasProfiles caHasProfiles = new CaHasProfiles();
    final String sql = "SELECT CA_ID,PROFILE_ID FROM CA_HAS_PROFILE";
    Statement stmt = null;
    ResultSet rs = null;
    try {
        stmt = createStatement();
        rs = stmt.executeQuery(sql);
        while (rs.next()) {
            CaHasProfileType caHasProfile = new CaHasProfileType();
            caHasProfile.setCaId(rs.getInt("CA_ID"));
            caHasProfile.setProfileId(rs.getInt("PROFILE_ID"));
            caHasProfiles.getCaHasProfile().add(caHasProfile);
        }
    } catch (SQLException ex) {
        throw translate(sql, ex);
    } finally {
        releaseResources(stmt, rs);
    }
    caconf.setCaHasProfiles(caHasProfiles);
    System.out.println(" exported table CA_HAS_PROFILE");
}
Also used : CaHasProfileType(org.xipki.ca.dbtool.jaxb.ca.CaHasProfileType) SQLException(java.sql.SQLException) Statement(java.sql.Statement) ResultSet(java.sql.ResultSet) CaHasProfiles(org.xipki.ca.dbtool.jaxb.ca.CAConfigurationType.CaHasProfiles)

Aggregations

ResultSet (java.sql.ResultSet)1 SQLException (java.sql.SQLException)1 Statement (java.sql.Statement)1 CaHasProfiles (org.xipki.ca.dbtool.jaxb.ca.CAConfigurationType.CaHasProfiles)1 CaHasProfileType (org.xipki.ca.dbtool.jaxb.ca.CaHasProfileType)1