|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.InputStream
org.postgresql.copy.PGCopyInputStream
public class PGCopyInputStream
InputStream for reading from a PostgreSQL COPY TO STDOUT operation
| Constructor Summary | |
|---|---|
PGCopyInputStream(CopyOut op)
Use given CopyOut operation for reading |
|
PGCopyInputStream(PGConnection connection,
String sql)
Uses given connection for specified COPY TO STDOUT operation |
|
| Method Summary | |
|---|---|
int |
available()
|
void |
cancelCopy()
Cancels this copy operation, discarding any exchanged data. |
void |
close()
|
int |
getFieldCount()
|
int |
getFieldFormat(int field)
|
int |
getFormat()
|
long |
getHandledRowCount()
After succesful end of copy, returns the number of database records handled in that operation. |
boolean |
isActive()
|
int |
read()
|
int |
read(byte[] buf)
|
int |
read(byte[] buf,
int off,
int siz)
|
byte[] |
readFromCopy()
|
| Methods inherited from class java.io.InputStream |
|---|
mark, markSupported, reset, skip |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PGCopyInputStream(PGConnection connection,
String sql)
throws SQLException
connection - database connection to use for copying (protocol version 3 required)sql - COPY TO STDOUT statement
SQLException - if initializing the operation failspublic PGCopyInputStream(CopyOut op)
op - COPY TO STDOUT operation
SQLException - if initializing the operation fails| Method Detail |
|---|
public int available()
throws IOException
available in class InputStreamIOException
public int read()
throws IOException
read in class InputStreamIOException
public int read(byte[] buf)
throws IOException
read in class InputStreamIOException
public int read(byte[] buf,
int off,
int siz)
throws IOException
read in class InputStreamIOException
public byte[] readFromCopy()
throws SQLException
readFromCopy in interface CopyOutSQLException
public void close()
throws IOException
close in interface Closeableclose in class InputStreamIOException
public void cancelCopy()
throws SQLException
CopyOperation
cancelCopy in interface CopyOperationSQLException - if cancelling failspublic int getFormat()
getFormat in interface CopyOperationpublic int getFieldFormat(int field)
getFieldFormat in interface CopyOperationfield - number of field (0..fieldCount()-1)
public int getFieldCount()
getFieldCount in interface CopyOperationpublic boolean isActive()
isActive in interface CopyOperationpublic long getHandledRowCount()
CopyOperation
getHandledRowCount in interface CopyOperation
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||