public class CopyManager
extends java.lang.Object
Constructor and Description |
---|
CopyManager(BaseConnection connection) |
Modifier and Type | Method and Description |
---|---|
CopyDual |
copyDual(java.lang.String sql) |
CopyIn |
copyIn(java.lang.String sql) |
long |
copyIn(java.lang.String sql,
ByteStreamWriter from)
Use COPY FROM STDIN for very fast copying from an ByteStreamWriter into a database table.
|
long |
copyIn(java.lang.String sql,
java.io.InputStream from)
Use COPY FROM STDIN for very fast copying from an InputStream into a database table.
|
long |
copyIn(java.lang.String sql,
java.io.InputStream from,
int bufferSize)
Use COPY FROM STDIN for very fast copying from an InputStream into a database table.
|
long |
copyIn(java.lang.String sql,
java.io.Reader from)
Use COPY FROM STDIN for very fast copying from a Reader into a database table.
|
long |
copyIn(java.lang.String sql,
java.io.Reader from,
int bufferSize)
Use COPY FROM STDIN for very fast copying from a Reader into a database table.
|
CopyOut |
copyOut(java.lang.String sql) |
long |
copyOut(java.lang.String sql,
java.io.OutputStream to)
Pass results of a COPY TO STDOUT query from database into an OutputStream.
|
long |
copyOut(java.lang.String sql,
java.io.Writer to)
Pass results of a COPY TO STDOUT query from database into a Writer.
|
public CopyManager(BaseConnection connection) throws java.sql.SQLException
java.sql.SQLException
public CopyIn copyIn(java.lang.String sql) throws java.sql.SQLException
java.sql.SQLException
public CopyOut copyOut(java.lang.String sql) throws java.sql.SQLException
java.sql.SQLException
public CopyDual copyDual(java.lang.String sql) throws java.sql.SQLException
java.sql.SQLException
public long copyOut(java.lang.String sql, java.io.Writer to) throws java.sql.SQLException, java.io.IOException
sql
- COPY TO STDOUT statementto
- the Writer to write the results to (row by row).
The Writer is not closed at the end of the Copy Out operation.java.sql.SQLException
- on database usage errorsjava.io.IOException
- upon writer or database connection failurepublic long copyOut(java.lang.String sql, java.io.OutputStream to) throws java.sql.SQLException, java.io.IOException
sql
- COPY TO STDOUT statementto
- the stream to write the results to (row by row)
The stream is not closed at the end of the operation. This is intentional so the
caller can continue to write to the output streamjava.sql.SQLException
- on database usage errorsjava.io.IOException
- upon output stream or database connection failurepublic long copyIn(java.lang.String sql, java.io.Reader from) throws java.sql.SQLException, java.io.IOException
sql
- COPY FROM STDIN statementfrom
- a CSV file or suchjava.sql.SQLException
- on database usage issuesjava.io.IOException
- upon reader or database connection failurepublic long copyIn(java.lang.String sql, java.io.Reader from, int bufferSize) throws java.sql.SQLException, java.io.IOException
sql
- COPY FROM STDIN statementfrom
- a CSV file or suchbufferSize
- number of characters to buffer and push over network to server at oncejava.sql.SQLException
- on database usage issuesjava.io.IOException
- upon reader or database connection failurepublic long copyIn(java.lang.String sql, java.io.InputStream from) throws java.sql.SQLException, java.io.IOException
sql
- COPY FROM STDIN statementfrom
- a CSV file or suchjava.sql.SQLException
- on database usage issuesjava.io.IOException
- upon input stream or database connection failurepublic long copyIn(java.lang.String sql, java.io.InputStream from, int bufferSize) throws java.sql.SQLException, java.io.IOException
sql
- COPY FROM STDIN statementfrom
- a CSV file or suchbufferSize
- number of bytes to buffer and push over network to server at oncejava.sql.SQLException
- on database usage issuesjava.io.IOException
- upon input stream or database connection failurepublic long copyIn(java.lang.String sql, ByteStreamWriter from) throws java.sql.SQLException, java.io.IOException
sql
- COPY FROM STDIN statementfrom
- the source of bytes, e.g. a ByteBufferByteStreamWriterjava.sql.SQLException
- on database usage issuesjava.io.IOException
- upon input stream or database connection failureCopyright © 2024 PostgreSQL Global Development Group. All rights reserved.