public interface PGConnection
Modifier and Type | Method and Description |
---|---|
void |
addDataType(java.lang.String type,
java.lang.Class klass)
This allows client code to add a handler for one of org.postgresql's
more unique data types.
|
void |
addDataType(java.lang.String type,
java.lang.String name)
Deprecated.
As of 8.0, replaced by
addDataType(String,Class) . This deprecated method does not
work correctly for registering classes that cannot be directly loaded
by the JDBC driver's classloader. |
java.lang.String |
escapeIdentifier(java.lang.String identifier)
Return the given string suitably quoted to be used as an identifier in an SQL statement string.
|
java.lang.String |
escapeLiteral(java.lang.String literal)
Return the given string suitably quoted to be used as a string literal in an SQL statement string.
|
int |
getBackendPID()
Return the process ID (PID) of the backend server process handling this connection.
|
CopyManager |
getCopyAPI()
This returns the COPY API for the current connection.
|
int |
getDefaultFetchSize()
Get the default fetch size for statements created from this connection
|
Fastpath |
getFastpathAPI()
This returns the Fastpath API for the current connection.
|
LargeObjectManager |
getLargeObjectAPI()
This returns the LargeObject API for the current connection.
|
PGNotification[] |
getNotifications()
This method returns any notifications that have been received
since the last call to this method.
|
int |
getPrepareThreshold()
Get the default server-side prepare reuse threshold for statements created
from this connection.
|
void |
setDefaultFetchSize(int fetchSize)
Set the default fetch size for statements created from this connection
|
void |
setPrepareThreshold(int threshold)
Set the default statement reuse threshold before enabling server-side
prepare.
|
PGNotification[] getNotifications() throws java.sql.SQLException
java.sql.SQLException
CopyManager getCopyAPI() throws java.sql.SQLException
java.sql.SQLException
LargeObjectManager getLargeObjectAPI() throws java.sql.SQLException
java.sql.SQLException
Fastpath getFastpathAPI() throws java.sql.SQLException
java.sql.SQLException
void addDataType(java.lang.String type, java.lang.String name)
addDataType(String,Class)
. This deprecated method does not
work correctly for registering classes that cannot be directly loaded
by the JDBC driver's classloader.addDataType(type, Class.forName(name))
.java.lang.RuntimeException
- if the type cannot be registered (class not
found, etc).void addDataType(java.lang.String type, java.lang.Class klass) throws java.sql.SQLException
NOTE: This is not part of JDBC, but an extension.
The best way to use this is as follows:
... ((org.postgresql.PGConnection)myconn).addDataType("mytype", my.class.name.class); ...
where myconn is an open Connection to org.postgresql.
The handling class must extend org.postgresql.util.PGobject
void setPrepareThreshold(int threshold)
PGStatement.setPrepareThreshold(int)
for
details.threshold
- the new thresholdint getPrepareThreshold()
void setDefaultFetchSize(int fetchSize) throws java.sql.SQLException
fetchSize
- new default fetch sizejava.sql.SQLException
- if specified negative fetchSize
parameterStatement.setFetchSize(int)
int getDefaultFetchSize()
PGProperty.DEFAULT_ROW_FETCH_SIZE
,
Statement.getFetchSize()
int getBackendPID()
java.lang.String escapeIdentifier(java.lang.String identifier) throws java.sql.SQLException
java.sql.SQLException
java.lang.String escapeLiteral(java.lang.String literal) throws java.sql.SQLException
java.sql.SQLException