org.postgresql.core.v3
Class CopyOutImpl

java.lang.Object
  extended by org.postgresql.core.v3.CopyOperationImpl
      extended by org.postgresql.core.v3.CopyOutImpl
All Implemented Interfaces:
CopyOperation, CopyOut

public class CopyOutImpl
extends CopyOperationImpl
implements CopyOut

Anticipated flow of a COPY TO STDOUT operation: CopyManager.copyOut() ->QueryExecutor.startCopy() - sends given query to server ->processCopyResults(): - receives CopyOutResponse from Server - creates new CopyOutImpl ->initCopy(): - receives copy metadata from server ->CopyOutImpl.init() ->lock() connection for this operation - if query fails an exception is thrown - if query returns wrong CopyOperation, copyOut() cancels it before throwing exception <-returned: new CopyOutImpl holding lock on connection repeat CopyOut.readFromCopy() until null ->CopyOutImpl.readFromCopy() ->QueryExecutorImpl.readFromCopy() ->processCopyResults() - on copydata row from server ->CopyOutImpl.handleCopydata() stores reference to byte array - on CopyDone, CommandComplete, ReadyForQuery ->unlock() connection for use by other operations <-returned: byte array of data received from server or null at end.


Constructor Summary
CopyOutImpl()
           
 
Method Summary
 byte[] readFromCopy()
           
 
Methods inherited from class org.postgresql.core.v3.CopyOperationImpl
cancelCopy, getFieldCount, getFieldFormat, getFormat, getHandledRowCount, handleCommandStatus, isActive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.postgresql.copy.CopyOperation
cancelCopy, getFieldCount, getFieldFormat, getFormat, getHandledRowCount, isActive
 

Constructor Detail

CopyOutImpl

public CopyOutImpl()
Method Detail

readFromCopy

public byte[] readFromCopy()
                    throws SQLException
Specified by:
readFromCopy in interface CopyOut
Throws:
SQLException


Copyright © 2013. All Rights Reserved.