public void atomicInsertStagingTable() throws SQLException {
        Statement statement = this.getConnection().createStatement();
        StringBuilder sql = new StringBuilder();
        String allColls = null;
        try {
            allColls = getAllSinkColumns(null);
        } catch (NullPointerException e) {
            // Ignore this exception
        }

        if (allColls != null) {
            sql.append(" INSERT INTO ")
                    .append(this.getSinkTableName())
                    .append(" (" + allColls + ")")
                    .append(" SELECT ")
                    .append(allColls)
                    .append(" FROM ")
                    .append(getQualifiedStagingTableName());
        } else {
            sql.append(" INSERT INTO ")
                    .append(this.getSinkTableName())
                    .append(" SELECT * ")
                    .append(" FROM ")
                    .append(getQualifiedStagingTableName());
        }

        LOG.info("Inserting data from staging table to sink table within a transaction: {}", sql);
        statement.executeUpdate(sql.toString());
        statement.close();
        this.getConnection().commit();
    }
Insert all rows from staging table to the sink table within a transaction

@throws SQLException
src/main/java/org/replicadb/manager/SqlManager.java