use of org.xipki.ca.dbtool.jaxb.ca.CAConfigurationType.Publishers in project xipki by xipki.
the class CaConfigurationDbExporter method exportPublisher.
// method exportResponder
private void exportPublisher(CAConfigurationType caconf) throws DataAccessException, IOException {
System.out.println("exporting table PUBLISHER");
Publishers publishers = new Publishers();
final String sql = "SELECT ID,NAME,TYPE,CONF FROM PUBLISHER";
Statement stmt = null;
ResultSet rs = null;
try {
stmt = createStatement();
rs = stmt.executeQuery(sql);
while (rs.next()) {
String name = rs.getString("NAME");
PublisherType publisher = new PublisherType();
publisher.setId(rs.getInt("ID"));
publisher.setName(name);
publisher.setType(rs.getString("TYPE"));
publisher.setConf(buildFileOrValue(rs.getString("CONF"), "ca-conf/conf-publisher-" + name));
publishers.getPublisher().add(publisher);
}
} catch (SQLException ex) {
throw translate(sql, ex);
} finally {
releaseResources(stmt, rs);
}
caconf.setPublishers(publishers);
System.out.println(" exported table PUBLISHER");
}
Aggregations