Package org.postgresql.core.v3
Class CopyOperationImpl
- java.lang.Object
-
- org.postgresql.core.v3.CopyOperationImpl
-
- All Implemented Interfaces:
CopyOperation
- Direct Known Subclasses:
CopyDualImpl,CopyInImpl,CopyOutImpl
public abstract class CopyOperationImpl extends java.lang.Object implements CopyOperation
-
-
Constructor Summary
Constructors Constructor Description CopyOperationImpl()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcancelCopy()Cancels this copy operation, discarding any exchanged data.intgetFieldCount()intgetFieldFormat(int field)intgetFormat()longgetHandledRowCount()After successful end of copy, returns the number of database records handled in that operation.protected QueryExecutorImplgetQueryExecutor()voidhandleCommandStatus(java.lang.String status)protected abstract voidhandleCopydata(byte[] data)Consume received copy data.booleanisActive()
-
-
-
Method Detail
-
getQueryExecutor
protected QueryExecutorImpl getQueryExecutor()
-
cancelCopy
public void cancelCopy() throws java.sql.SQLExceptionDescription copied from interface:CopyOperationCancels this copy operation, discarding any exchanged data.- Specified by:
cancelCopyin interfaceCopyOperation- Throws:
java.sql.SQLException- if cancelling fails
-
getFieldCount
public int getFieldCount()
- Specified by:
getFieldCountin interfaceCopyOperation- Returns:
- number of fields in each row for this operation
-
getFieldFormat
public int getFieldFormat(int field)
- Specified by:
getFieldFormatin interfaceCopyOperation- Parameters:
field- number of field (0..fieldCount()-1)- Returns:
- format of requested field: 0 = textual, 1 = binary
-
getFormat
public int getFormat()
- Specified by:
getFormatin interfaceCopyOperation- Returns:
- overall format of each row: 0 = textual, 1 = binary
-
isActive
public boolean isActive()
- Specified by:
isActivein interfaceCopyOperation- Returns:
- is connection reserved for this Copy operation?
-
handleCommandStatus
public void handleCommandStatus(java.lang.String status) throws PSQLException- Throws:
PSQLException
-
handleCopydata
protected abstract void handleCopydata(byte[] data) throws PSQLExceptionConsume received copy data.- Parameters:
data- data that was receive by copy protocol- Throws:
PSQLException- if some internal problem occurs
-
getHandledRowCount
public long getHandledRowCount()
Description copied from interface:CopyOperationAfter successful end of copy, returns the number of database records handled in that operation. Only implemented in PostgreSQL server version 8.2 and up. Otherwise, returns -1.- Specified by:
getHandledRowCountin interfaceCopyOperation- Returns:
- number of handled rows or -1
-
-