Search in sources :

Example 1 with CaHasPublishers

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

the class CaConfigurationDbExporter method exportCaHasPublisher.

// method exportCaHasRequestor
private void exportCaHasPublisher(CAConfigurationType caconf) throws DataAccessException {
    System.out.println("exporting table CA_HAS_PUBLISHER");
    CaHasPublishers caHasPublishers = new CaHasPublishers();
    final String sql = "SELECT CA_ID,PUBLISHER_ID FROM CA_HAS_PUBLISHER";
    Statement stmt = null;
    ResultSet rs = null;
    try {
        stmt = createStatement();
        rs = stmt.executeQuery(sql);
        while (rs.next()) {
            CaHasPublisherType caHasPublisher = new CaHasPublisherType();
            caHasPublisher.setCaId(rs.getInt("CA_ID"));
            caHasPublisher.setPublisherId(rs.getInt("PUBLISHER_ID"));
            caHasPublishers.getCaHasPublisher().add(caHasPublisher);
        }
    } catch (SQLException ex) {
        throw translate(sql, ex);
    } finally {
        releaseResources(stmt, rs);
    }
    caconf.setCaHasPublishers(caHasPublishers);
    System.out.println(" exported table CA_HAS_PUBLISHER");
}
Also used : CaHasPublisherType(org.xipki.ca.dbtool.jaxb.ca.CaHasPublisherType) SQLException(java.sql.SQLException) Statement(java.sql.Statement) ResultSet(java.sql.ResultSet) CaHasPublishers(org.xipki.ca.dbtool.jaxb.ca.CAConfigurationType.CaHasPublishers)

Aggregations

ResultSet (java.sql.ResultSet)1 SQLException (java.sql.SQLException)1 Statement (java.sql.Statement)1 CaHasPublishers (org.xipki.ca.dbtool.jaxb.ca.CAConfigurationType.CaHasPublishers)1 CaHasPublisherType (org.xipki.ca.dbtool.jaxb.ca.CaHasPublisherType)1