public CopyOut copyOut(String sql) throws SQLException { CopyOperation op = queryExecutor.startCopy(sql, connection.getAutoCommit()); if (op == null || op instanceof CopyOut) { return (CopyOut) op; } else { op.cancelCopy(); throw new PSQLException(GT.tr("Requested CopyOut but got {0}", op.getClass().getName()), PSQLState.WRONG_OBJECT_TYPE); } }
public CopyIn copyIn(String sql) throws SQLException { CopyOperation op = queryExecutor.startCopy(sql, connection.getAutoCommit()); if (op == null || op instanceof CopyIn) { return (CopyIn) op; } else { op.cancelCopy(); throw new PSQLException(GT.tr("Requested CopyIn but got {0}", op.getClass().getName()), PSQLState.WRONG_OBJECT_TYPE); } }
public CopyDual copyDual(String sql) throws SQLException { CopyOperation op = queryExecutor.startCopy(sql, connection.getAutoCommit()); if (op == null || op instanceof CopyDual) { return (CopyDual) op; } else { op.cancelCopy(); throw new PSQLException(GT.tr("Requested CopyDual but got {0}", op.getClass().getName()), PSQLState.WRONG_OBJECT_TYPE); } }
public CopyOut copyOut(String sql) throws SQLException { CopyOperation op = null; try { op = queryExecutor.startCopy(sql, connection.getAutoCommit()); return (CopyOut) op; } catch(ClassCastException cce) { op.cancelCopy(); throw new PSQLException(GT.tr("Requested CopyOut but got {0}", op.getClass().getName()), PSQLState.WRONG_OBJECT_TYPE, cce); } }
public CopyIn copyIn(String sql) throws SQLException { CopyOperation op = null; try { op = queryExecutor.startCopy(sql, connection.getAutoCommit()); return (CopyIn) op; } catch(ClassCastException cce) { op.cancelCopy(); throw new PSQLException(GT.tr("Requested CopyIn but got {0}", op.getClass().getName()), PSQLState.WRONG_OBJECT_TYPE, cce); } }
private PGReplicationStream initializeReplication(String query, CommonOptions options, ReplicationType replicationType) throws SQLException { LOGGER.log(Level.FINEST, " FE=> StartReplication(query: {0})", query); configureSocketTimeout(options); CopyDual copyDual = (CopyDual) queryExecutor.startCopy(query, true); return new V3PGReplicationStream( copyDual, options.getStartLSNPosition(), options.getStatusInterval(), replicationType ); }
public CopyOut copyOut(String sql) throws SQLException { CopyOperation op = null; try { op = queryExecutor.startCopy(sql, connection.getAutoCommit()); return (CopyOut) op; } catch(ClassCastException cce) { op.cancelCopy(); throw new PSQLException(GT.tr("Requested CopyOut but got {0}", op.getClass().getName()), PSQLState.WRONG_OBJECT_TYPE, cce); } }
public CopyIn copyIn(String sql) throws SQLException { CopyOperation op = null; try { op = queryExecutor.startCopy(sql, connection.getAutoCommit()); return (CopyIn) op; } catch(ClassCastException cce) { op.cancelCopy(); throw new PSQLException(GT.tr("Requested CopyIn but got {0}", op.getClass().getName()), PSQLState.WRONG_OBJECT_TYPE, cce); } }
public CopyOut copyOut(String sql) throws SQLException { CopyOperation op = null; try { op = queryExecutor.startCopy(sql, connection.getAutoCommit()); return (CopyOut) op; } catch(ClassCastException cce) { op.cancelCopy(); throw new PSQLException(GT.tr("Requested CopyOut but got {0}", op.getClass().getName()), PSQLState.WRONG_OBJECT_TYPE, cce); } }
public CopyIn copyIn(String sql) throws SQLException { CopyOperation op = null; try { op = queryExecutor.startCopy(sql, connection.getAutoCommit()); return (CopyIn) op; } catch(ClassCastException cce) { op.cancelCopy(); throw new PSQLException(GT.tr("Requested CopyIn but got {0}", op.getClass().getName()), PSQLState.WRONG_OBJECT_TYPE, cce); } }