|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.postgresql.pljava.jdbc.SPIConnection
public class SPIConnection
Provides access to the current connection (session) the Java stored
procedure is running in. It is returned from the driver manager
with
DriverManager.getConnection("jdbc:default:connection");
and cannot be managed in any way since it's already running inside
a transaction. This means the following methods cannot be used.
commit()rollback()setAutoCommit()setTransactionIsolation()
| Field Summary | |
|---|---|
static int[] |
JDBC_TYPE_NUMBERS
|
static java.lang.String[] |
JDBC3_TYPE_NAMES
|
| Fields inherited from interface java.sql.Connection |
|---|
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE |
| Constructor Summary | |
|---|---|
SPIConnection()
|
|
| Method Summary | ||
|---|---|---|
void |
clearWarnings()
Warnings are not yet supported. |
|
void |
close()
This is a no-op. |
|
void |
commit()
It's not legal to do a commit within a call from SQL. |
|
java.sql.Array |
createArrayOf(java.lang.String typeName,
java.lang.Object[] elements)
|
|
java.sql.Blob |
createBlob()
|
|
java.sql.Clob |
createClob()
|
|
java.sql.NClob |
createNClob()
|
|
java.sql.SQLXML |
createSQLXML()
|
|
java.sql.Statement |
createStatement()
Creates a new instance of SPIStatement. |
|
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency)
Creates a new instance of SPIStatement. |
|
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
Creates a new instance of SPIStatement. |
|
java.sql.Struct |
createStruct(java.lang.String typeName,
java.lang.Object[] attributes)
|
|
boolean |
getAutoCommit()
It is assumed that an SPI call is under transaction control. |
|
java.lang.String |
getCatalog()
Returns the database in which we are running. |
|
java.util.Properties |
getClientInfo()
|
|
java.lang.String |
getClientInfo(java.lang.String name)
|
|
static java.sql.Connection |
getDefault()
Returns a default connection instance. |
|
int |
getHoldability()
Returns ResultSet.CLOSE_CURSORS_AT_COMMIT. |
|
java.sql.DatabaseMetaData |
getMetaData()
Retrieves an instance of SPIDatabaseMetaData
representing this Connection object. |
|
java.lang.String |
getPGType(Oid oid)
|
|
int |
getSQLType(Oid oid)
|
|
int |
getSQLType(java.lang.String pgTypeName)
|
|
int |
getTransactionIsolation()
Returns Connection.TRANSACTION_READ_COMMITTED. |
|
java.util.Map |
getTypeMap()
Returns null. |
|
int[] |
getVersionNumber()
|
|
java.sql.SQLWarning |
getWarnings()
Warnings are not yet supported. |
|
boolean |
isClosed()
Will always return false. |
|
boolean |
isReadOnly()
Returns false. |
|
boolean |
isValid(int timeout)
|
|
boolean |
isWrapperFor(java.lang.Class<?> iface)
|
|
java.lang.String |
nativeSQL(java.lang.String sql)
Parse the JDBC SQL into PostgreSQL. |
|
java.lang.String |
nativeSQL(java.lang.String sql,
int[] paramCountRet)
|
|
java.sql.CallableStatement |
prepareCall(java.lang.String sql)
Procedure calls are not yet implemented. |
|
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
Procedure calls are not yet implemented. |
|
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
Procedure calls are not yet implemented. |
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql)
Creates a new instance of SPIPreparedStatement. |
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int autoGeneratedKeys)
Return of auto generated keys is not yet supported. |
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int[] columnIndexes)
Return of auto generated keys is not yet supported. |
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
Creates a new instance of SPIPreparedStatement. |
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
Creates a new instance of SPIPreparedStatement. |
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
java.lang.String[] columnNames)
Return of auto generated keys is not yet supported. |
|
void |
releaseSavepoint(java.sql.Savepoint savepoint)
|
|
void |
rollback()
It's not legal to do a rollback within a call from SQL. |
|
void |
rollback(java.sql.Savepoint savepoint)
|
|
void |
setAutoCommit(boolean autoCommit)
It is assumed that an SPI call is under transaction control. |
|
void |
setCatalog(java.lang.String catalog)
The catalog name cannot be set. |
|
void |
setClientInfo(java.util.Properties properties)
|
|
void |
setClientInfo(java.lang.String name,
java.lang.String value)
|
|
void |
setHoldability(int holdability)
Change of holdability is not supported. |
|
void |
setReadOnly(boolean readOnly)
It is assumed that an inserts and updates can be performed using and SPIConnection. |
|
java.sql.Savepoint |
setSavepoint()
|
|
java.sql.Savepoint |
setSavepoint(java.lang.String name)
|
|
void |
setTransactionIsolation(int level)
Change of transaction isolation level is not supported. |
|
void |
setTypeMap(java.util.Map map)
Type map is not yet implemented. |
|
|
unwrap(java.lang.Class<T> iface)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String[] JDBC3_TYPE_NAMES
public static final int[] JDBC_TYPE_NUMBERS
| Constructor Detail |
|---|
public SPIConnection()
| Method Detail |
|---|
public static java.sql.Connection getDefault()
throws java.sql.SQLException
java.sql.SQLExceptionpublic int getHoldability()
ResultSet.CLOSE_CURSORS_AT_COMMIT. Cursors are actually
closed when a function returns to SQL.
getHoldability in interface java.sql.Connectionpublic int getTransactionIsolation()
Connection.TRANSACTION_READ_COMMITTED.
getTransactionIsolation in interface java.sql.Connection
public void clearWarnings()
throws java.sql.SQLException
clearWarnings in interface java.sql.Connectionjava.sql.SQLException - indicating that this feature is not supported.public void close()
close in interface java.sql.Connection
public void commit()
throws java.sql.SQLException
commit in interface java.sql.Connectionjava.sql.SQLException - indicating that this feature is not supported.
public void rollback()
throws java.sql.SQLException
rollback in interface java.sql.Connectionjava.sql.SQLException - indicating that this feature is not supported.public boolean getAutoCommit()
false.
getAutoCommit in interface java.sql.Connectionpublic boolean isClosed()
isClosed in interface java.sql.Connectionpublic boolean isReadOnly()
false. The SPIConnection is not real-only.
isReadOnly in interface java.sql.Connection
public void setHoldability(int holdability)
throws java.sql.SQLException
setHoldability in interface java.sql.Connectionjava.sql.SQLException - indicating that this feature is not supported.
public void setTransactionIsolation(int level)
throws java.sql.SQLException
setTransactionIsolation in interface java.sql.Connectionjava.sql.SQLException - indicating that this feature is not supported.
public void setAutoCommit(boolean autoCommit)
throws java.sql.SQLException
setAutoCommit in interface java.sql.Connectionjava.sql.SQLException - indicating that this feature is not supported.
public void setReadOnly(boolean readOnly)
throws java.sql.SQLException
setReadOnly in interface java.sql.Connectionjava.sql.SQLException - indicating that this feature is not supported.
public java.lang.String getCatalog()
throws java.sql.SQLException
getCatalog in interface java.sql.Connectionjava.sql.SQLException
public void setCatalog(java.lang.String catalog)
throws java.sql.SQLException
setCatalog in interface java.sql.Connectionjava.sql.SQLException - indicating that this feature is not supported.public java.sql.DatabaseMetaData getMetaData()
SPIDatabaseMetaData
representing this Connection object. The
metadata includes information about the SQL grammar
supported by PostgreSQL, the capabilities of PL/Java, as
well as the tables and stored procedures for this
connection and so on.
getMetaData in interface java.sql.ConnectionConnection object
public java.sql.SQLWarning getWarnings()
throws java.sql.SQLException
getWarnings in interface java.sql.Connectionjava.sql.SQLException - indicating that this feature is not supported.
public void releaseSavepoint(java.sql.Savepoint savepoint)
throws java.sql.SQLException
releaseSavepoint in interface java.sql.Connectionjava.sql.SQLException
public void rollback(java.sql.Savepoint savepoint)
throws java.sql.SQLException
rollback in interface java.sql.Connectionjava.sql.SQLException
public java.sql.Statement createStatement()
throws java.sql.SQLException
SPIStatement.
createStatement in interface java.sql.Connectionjava.sql.SQLException
public java.sql.Statement createStatement(int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
SPIStatement.
createStatement in interface java.sql.Connectionjava.sql.SQLException - if the resultSetType differs from
ResultSet.TYPE_FORWARD_ONLY or if the
resultSetConcurrencty differs from
ResultSet.CONCUR_READ_ONLY.
public java.sql.Statement createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws java.sql.SQLException
SPIStatement.
createStatement in interface java.sql.Connectionjava.sql.SQLException - if the resultSetType differs from ResultSet.TYPE_FORWARD_ONLY, if the resultSetConcurrencty
differs from ResultSet.CONCUR_READ_ONLY, or if the
resultSetHoldability differs from ResultSet.CLOSE_CURSORS_AT_COMMIT.
public java.util.Map getTypeMap()
throws java.sql.SQLException
null. Type map is not yet imlemented.
getTypeMap in interface java.sql.Connectionjava.sql.SQLException
public void setTypeMap(java.util.Map map)
throws java.sql.SQLException
setTypeMap in interface java.sql.Connectionjava.sql.SQLException - indicating that this feature is not supported.
public java.lang.String nativeSQL(java.lang.String sql)
throws java.sql.SQLException
nativeSQL in interface java.sql.Connectionjava.sql.SQLException
public java.lang.String nativeSQL(java.lang.String sql,
int[] paramCountRet)
public java.sql.CallableStatement prepareCall(java.lang.String sql)
throws java.sql.SQLException
prepareCall in interface java.sql.Connectionjava.sql.SQLException - indicating that this feature is not supported.
public java.sql.CallableStatement prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
prepareCall in interface java.sql.Connectionjava.sql.SQLException - indicating that this feature is not supported.
public java.sql.CallableStatement prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws java.sql.SQLException
prepareCall in interface java.sql.Connectionjava.sql.SQLException - indicating that this feature is not supported.
public java.sql.PreparedStatement prepareStatement(java.lang.String sql)
throws java.sql.SQLException
SPIPreparedStatement.
prepareStatement in interface java.sql.Connectionjava.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int autoGeneratedKeys)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLException - indicating that this feature is not supported.
public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
SPIPreparedStatement.
prepareStatement in interface java.sql.Connectionjava.sql.SQLException - if the resultSetType differs from ResultSet.TYPE_FORWARD_ONLY or if the resultSetConcurrencty
differs from ResultSet.CONCUR_READ_ONLY.
public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws java.sql.SQLException
SPIPreparedStatement.
prepareStatement in interface java.sql.Connectionjava.sql.SQLException - if the resultSetType differs from ResultSet.TYPE_FORWARD_ONLY, if the resultSetConcurrencty
differs from ResultSet.CONCUR_READ_ONLY, or if the
resultSetHoldability differs from ResultSet.CLOSE_CURSORS_AT_COMMIT.
public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int[] columnIndexes)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLException - indicating that this feature is not supported.
public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
java.lang.String[] columnNames)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLException - indicating that this feature is not supported.
public java.sql.Savepoint setSavepoint()
throws java.sql.SQLException
setSavepoint in interface java.sql.Connectionjava.sql.SQLException
public java.sql.Savepoint setSavepoint(java.lang.String name)
throws java.sql.SQLException
setSavepoint in interface java.sql.Connectionjava.sql.SQLException
public int[] getVersionNumber()
throws java.sql.SQLException
java.sql.SQLExceptionpublic int getSQLType(java.lang.String pgTypeName)
public int getSQLType(Oid oid)
throws java.sql.SQLException
java.sql.SQLException
public java.lang.String getPGType(Oid oid)
throws java.sql.SQLException
java.sql.SQLException
public java.sql.Struct createStruct(java.lang.String typeName,
java.lang.Object[] attributes)
throws java.sql.SQLException
createStruct in interface java.sql.Connectionjava.sql.SQLException
public java.sql.Array createArrayOf(java.lang.String typeName,
java.lang.Object[] elements)
throws java.sql.SQLException
createArrayOf in interface java.sql.Connectionjava.sql.SQLException
public boolean isValid(int timeout)
throws java.sql.SQLException
isValid in interface java.sql.Connectionjava.sql.SQLException
public java.sql.SQLXML createSQLXML()
throws java.sql.SQLException
createSQLXML in interface java.sql.Connectionjava.sql.SQLException
public java.sql.NClob createNClob()
throws java.sql.SQLException
createNClob in interface java.sql.Connectionjava.sql.SQLException
public java.sql.Blob createBlob()
throws java.sql.SQLException
createBlob in interface java.sql.Connectionjava.sql.SQLException
public java.sql.Clob createClob()
throws java.sql.SQLException
createClob in interface java.sql.Connectionjava.sql.SQLException
public boolean isWrapperFor(java.lang.Class<?> iface)
throws java.sql.SQLException
isWrapperFor in interface java.sql.Wrapperjava.sql.SQLException
public <T> T unwrap(java.lang.Class<T> iface)
throws java.sql.SQLException
unwrap in interface java.sql.Wrapperjava.sql.SQLException
public void setClientInfo(java.lang.String name,
java.lang.String value)
throws java.sql.SQLClientInfoException
setClientInfo in interface java.sql.Connectionjava.sql.SQLClientInfoException
public void setClientInfo(java.util.Properties properties)
throws java.sql.SQLClientInfoException
setClientInfo in interface java.sql.Connectionjava.sql.SQLClientInfoException
public java.lang.String getClientInfo(java.lang.String name)
throws java.sql.SQLException
getClientInfo in interface java.sql.Connectionjava.sql.SQLException
public java.util.Properties getClientInfo()
throws java.sql.SQLException
getClientInfo in interface java.sql.Connectionjava.sql.SQLException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||