Search in sources :

Example 1 with Profiles

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

the class CaConfigurationDbExporter method exportProfile.

// method exportPublisher
private void exportProfile(CAConfigurationType caconf) throws DataAccessException, IOException {
    System.out.println("exporting table PROFILE");
    Profiles profiles = new Profiles();
    final String sql = "SELECT ID,NAME,ART,TYPE,CONF FROM PROFILE";
    Statement stmt = null;
    ResultSet rs = null;
    try {
        stmt = createStatement();
        rs = stmt.executeQuery(sql);
        while (rs.next()) {
            String name = rs.getString("NAME");
            ProfileType profile = new ProfileType();
            profile.setId(rs.getInt("ID"));
            profile.setName(name);
            profile.setArt(rs.getInt("ART"));
            profile.setType(rs.getString("TYPE"));
            profile.setConf(buildFileOrValue(rs.getString("CONF"), "ca-conf/certprofile-" + name));
            profiles.getProfile().add(profile);
        }
    } catch (SQLException ex) {
        throw translate(sql, ex);
    } finally {
        releaseResources(stmt, rs);
    }
    caconf.setProfiles(profiles);
    System.out.println(" exported table PROFILE");
}
Also used : ProfileType(org.xipki.ca.dbtool.jaxb.ca.ProfileType) CaHasProfileType(org.xipki.ca.dbtool.jaxb.ca.CaHasProfileType) SQLException(java.sql.SQLException) Statement(java.sql.Statement) CaHasProfiles(org.xipki.ca.dbtool.jaxb.ca.CAConfigurationType.CaHasProfiles) Profiles(org.xipki.ca.dbtool.jaxb.ca.CAConfigurationType.Profiles) ResultSet(java.sql.ResultSet)

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 Profiles (org.xipki.ca.dbtool.jaxb.ca.CAConfigurationType.Profiles)1 CaHasProfileType (org.xipki.ca.dbtool.jaxb.ca.CaHasProfileType)1 ProfileType (org.xipki.ca.dbtool.jaxb.ca.ProfileType)1