@Override protected void flushBacklogInternal() throws SQLException { try { // flush out nodes PGCopyOutputStream nodesOut = new PGCopyOutputStream(PGCopyUtil.getWrappedConnection(connection.getJDBCConnection()), "COPY nodes(id,ntype,svalue,dvalue,ivalue,tvalue,tzoffset,bvalue,ltype,lang,createdAt) FROM STDIN (FORMAT csv)"); PGCopyUtil.flushNodes(nodeBacklog, nodesOut); nodesOut.close(); // flush out triples PGCopyOutputStream triplesOut = new PGCopyOutputStream(PGCopyUtil.getWrappedConnection(connection.getJDBCConnection()), "COPY triples FROM STDIN (FORMAT csv)"); PGCopyUtil.flushTriples(tripleBacklog, triplesOut); triplesOut.close(); } catch (IOException ex) { throw new SQLException("error while flushing out data",ex); } }
@Override protected void flushBacklogInternal() throws SQLException { try { // flush out nodes PGCopyOutputStream nodesOut = new PGCopyOutputStream(PGCopyUtil.getWrappedConnection(connection.getJDBCConnection()), "COPY nodes(id,ntype,svalue,dvalue,ivalue,tvalue,tzoffset,bvalue,ltype,lang,createdAt) FROM STDIN (FORMAT csv)"); PGCopyUtil.flushNodes(nodeBacklog, nodesOut); nodesOut.close(); // flush out triples PGCopyOutputStream triplesOut = new PGCopyOutputStream(PGCopyUtil.getWrappedConnection(connection.getJDBCConnection()), "COPY triples FROM STDIN (FORMAT csv)"); PGCopyUtil.flushTriples(tripleBacklog, triplesOut); triplesOut.close(); } catch (IOException ex) { throw new SQLException("error while flushing out data",ex); } }