パッケージ org.postgresql.copy
クラス PGCopyOutputStream
java.lang.Object
java.io.OutputStream
org.postgresql.copy.PGCopyOutputStream
- すべての実装されたインタフェース:
Closeable
,Flushable
,AutoCloseable
,CopyIn
,CopyOperation
OutputStream for buffered input into a PostgreSQL COPY FROM STDIN operation.
-
コンストラクタの概要
コンストラクタコンストラクタ説明Use given CopyIn operation for writing.PGCopyOutputStream
(CopyIn op, int bufferSize) Use given CopyIn operation for writing.PGCopyOutputStream
(PGConnection connection, String sql) Uses given connection for specified COPY FROM STDIN operation.PGCopyOutputStream
(PGConnection connection, String sql, int bufferSize) Uses given connection for specified COPY FROM STDIN operation. -
メソッドの概要
修飾子とタイプメソッド説明void
Cancels this copy operation, discarding any exchanged data.void
close()
long
endCopy()
Finishes copy operation successfully.void
flush()
void
Force any buffered output to be sent over the network to the backend.int
int
getFieldFormat
(int field) int
long
After successful end of copy, returns the number of database records handled in that operation.boolean
isActive()
void
write
(byte[] buf) void
write
(byte[] buf, int off, int siz) void
write
(int b) void
writeToCopy
(byte[] buf, int off, int siz) Writes specified part of given byte array to an open and writable copy operation.void
writeToCopy
(ByteStreamWriter from) Writes a ByteStreamWriter to an open and writable copy operation.クラスから継承されたメソッド java.io.OutputStream
nullOutputStream
-
コンストラクタの詳細
-
PGCopyOutputStream
Uses given connection for specified COPY FROM STDIN operation.- パラメータ:
connection
- database connection to use for copying (protocol version 3 required)sql
- COPY FROM STDIN statement- 例外:
SQLException
- if initializing the operation fails
-
PGCopyOutputStream
Uses given connection for specified COPY FROM STDIN operation.- パラメータ:
connection
- database connection to use for copying (protocol version 3 required)sql
- COPY FROM STDIN statementbufferSize
- try to send this many bytes at a time- 例外:
SQLException
- if initializing the operation fails
-
PGCopyOutputStream
Use given CopyIn operation for writing.- パラメータ:
op
- COPY FROM STDIN operation
-
PGCopyOutputStream
Use given CopyIn operation for writing.- パラメータ:
op
- COPY FROM STDIN operationbufferSize
- try to send this many bytes at a time
-
-
メソッドの詳細
-
write
- 定義:
write
クラス内OutputStream
- 例外:
IOException
-
write
- オーバーライド:
write
クラス内OutputStream
- 例外:
IOException
-
write
- オーバーライド:
write
クラス内OutputStream
- 例外:
IOException
-
close
- 定義:
close
インタフェース内AutoCloseable
- 定義:
close
インタフェース内Closeable
- オーバーライド:
close
クラス内OutputStream
- 例外:
IOException
-
flush
- 定義:
flush
インタフェース内Flushable
- オーバーライド:
flush
クラス内OutputStream
- 例外:
IOException
-
writeToCopy
インタフェースからコピーされた説明:CopyIn
Writes specified part of given byte array to an open and writable copy operation.- 定義:
writeToCopy
インタフェース内CopyIn
- パラメータ:
buf
- array of bytes to writeoff
- offset of first byte to write (normally zero)siz
- number of bytes to write (normally buf.length)- 例外:
SQLException
- if the operation fails
-
writeToCopy
インタフェースからコピーされた説明:CopyIn
Writes a ByteStreamWriter to an open and writable copy operation.- 定義:
writeToCopy
インタフェース内CopyIn
- パラメータ:
from
- the source of bytes, e.g. a ByteBufferByteStreamWriter- 例外:
SQLException
- if the operation 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
-
cancelCopy
インタフェースからコピーされた説明:CopyOperation
Cancels this copy operation, discarding any exchanged data.- 定義:
cancelCopy
インタフェース内CopyOperation
- 例外:
SQLException
- if cancelling fails
-
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?
-
flushCopy
インタフェースからコピーされた説明:CopyIn
Force any buffered output to be sent over the network to the backend. In general this is a useless operation as it will get pushed over in due time or when endCopy is called. Some specific modified server versions (Truviso) want this data sooner. If you are unsure if you need to use this method, don't.- 定義:
flushCopy
インタフェース内CopyIn
- 例外:
SQLException
- if the operation fails.
-
endCopy
インタフェースからコピーされた説明:CopyIn
Finishes copy operation successfully.- 定義:
endCopy
インタフェース内CopyIn
- 戻り値:
- number of updated rows for server 8.2 or newer (see getHandledRowCount())
- 例外:
SQLException
- if the operation fails.
-
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
-