パッケージ org.postgresql.copy
クラス PGCopyInputStream
java.lang.Object
java.io.InputStream
org.postgresql.copy.PGCopyInputStream
- すべての実装されたインタフェース:
Closeable
,AutoCloseable
,CopyOperation
,CopyOut
InputStream for reading from a PostgreSQL COPY TO STDOUT operation.
-
コンストラクタの概要
コンストラクタコンストラクタ説明Use given CopyOut operation for reading.PGCopyInputStream
(PGConnection connection, String sql) Uses given connection for specified COPY TO STDOUT operation. -
メソッドの概要
修飾子とタイプメソッド説明int
void
Cancels this copy operation, discarding any exchanged data.void
close()
int
int
getFieldFormat
(int field) int
long
After successful 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 @Nullable []
Blocks wait for a row of data to be received from server on an active copy operation.byte @Nullable []
readFromCopy
(boolean block) Wait for a row of data to be received from server on an active copy operation.クラスから継承されたメソッド java.io.InputStream
mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
コンストラクタの詳細
-
PGCopyInputStream
Uses given connection for specified COPY TO STDOUT operation.- パラメータ:
connection
- database connection to use for copying (protocol version 3 required)sql
- COPY TO STDOUT statement- 例外:
SQLException
- if initializing the operation fails
-
PGCopyInputStream
Use given CopyOut operation for reading.- パラメータ:
op
- COPY TO STDOUT operation
-
-
メソッドの詳細
-
available
- オーバーライド:
available
クラス内InputStream
- 例外:
IOException
-
read
- 定義:
read
クラス内InputStream
- 例外:
IOException
-
read
- オーバーライド:
read
クラス内InputStream
- 例外:
IOException
-
read
- オーバーライド:
read
クラス内InputStream
- 例外:
IOException
-
readFromCopy
インタフェースからコピーされた説明:CopyOut
Blocks wait for a row of data to be received from server on an active copy operation.- 定義:
readFromCopy
インタフェース内CopyOut
- 戻り値:
- byte array received from server, null if server complete copy operation
- 例外:
SQLException
- if something goes wrong for example socket timeout
-
readFromCopy
インタフェースからコピーされた説明:CopyOut
Wait for a row of data to be received from server on an active copy operation.- 定義:
readFromCopy
インタフェース内CopyOut
- パラメータ:
block
-true
if need wait data from server otherwisefalse
and will read pending message from server- 戻り値:
- byte array received from server, if pending message from server absent and use no blocking mode return null
- 例外:
SQLException
- if something goes wrong for example socket timeout
-
close
- 定義:
close
インタフェース内AutoCloseable
- 定義:
close
インタフェース内Closeable
- オーバーライド:
close
クラス内InputStream
- 例外:
IOException
-
cancelCopy
インタフェースからコピーされた説明:CopyOperation
Cancels this copy operation, discarding any exchanged data.- 定義:
cancelCopy
インタフェース内CopyOperation
- 例外:
SQLException
- if cancelling fails
-
getFormat
public int getFormat()- 定義:
getFormat
インタフェース内CopyOperation
- 戻り値:
- overall format of each row: 0 = textual, 1 = binary
-
getFieldFormat
public int getFieldFormat(int field) - 定義:
getFieldFormat
インタフェース内CopyOperation
- パラメータ:
field
- number of field (0..fieldCount()-1)- 戻り値:
- format of requested field: 0 = textual, 1 = binary
-
getFieldCount
public int getFieldCount()- 定義:
getFieldCount
インタフェース内CopyOperation
- 戻り値:
- number of fields in each row for this operation
-
isActive
public boolean isActive()- 定義:
isActive
インタフェース内CopyOperation
- 戻り値:
- is connection reserved for this Copy operation?
-
getHandledRowCount
public long getHandledRowCount()インタフェースからコピーされた説明:CopyOperation
After 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.- 定義:
getHandledRowCount
インタフェース内CopyOperation
- 戻り値:
- number of handled rows or -1
-