org.postgresql.pljava.jdbc

Class SPIConnection

Implemented Interfaces:
Connection

public class SPIConnection
extends java.lang.Object
implements Connection

Field Summary

static String[]
JDBC3_TYPE_NAMES
static int[]
JDBC_TYPE_NUMBERS

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.
Statement
createStatement()
Creates a new instance of SPIStatement.
Statement
createStatement(int resultSetType, int resultSetConcurrency)
Creates a new instance of SPIStatement.
Statement
createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)
Creates a new instance of SPIStatement.
boolean
getAutoCommit()
It is assumed that an SPI call is under transaction control.
String
getCatalog()
Returns null.
static Connection
getDefault()
Returns a default connection instance.
int
getHoldability()
Returns ResultSet.CLOSE_CURSORS_AT_COMMIT.
DatabaseMetaData
getMetaData()
DatabaseMetaData is not yet supported.
String
getPGType(Oid oid)
int
getSQLType(String pgTypeName)
int
getSQLType(Oid oid)
int
getTransactionIsolation()
Returns Connection.TRANSACTION_READ_COMMITTED.
Map
getTypeMap()
Returns null.
int[]
getVersionNumber()
SQLWarning
getWarnings()
Warnings are not yet supported.
boolean
isClosed()
Will always return false.
boolean
isReadOnly()
Returns false.
String
nativeSQL(String sql)
Parse the JDBC SQL into PostgreSQL.
String
nativeSQL(String sql, int[] paramCountRet)
CallableStatement
prepareCall(String sql)
Procedure calls are not yet implemented.
CallableStatement
prepareCall(String sql, int resultSetType, int resultSetConcurrency)
Procedure calls are not yet implemented.
CallableStatement
prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
Procedure calls are not yet implemented.
PreparedStatement
prepareStatement(String sql)
Creates a new instance of SPIPreparedStatement.
PreparedStatement
prepareStatement(String sql, String[] columnNames)
Return of auto generated keys is not yet supported.
PreparedStatement
prepareStatement(String sql, int autoGeneratedKeys)
Return of auto generated keys is not yet supported.
PreparedStatement
prepareStatement(String sql, int resultSetType, int resultSetConcurrency)
Creates a new instance of SPIPreparedStatement.
PreparedStatement
prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
Creates a new instance of SPIPreparedStatement.
PreparedStatement
prepareStatement(String sql, int[] columnIndexes)
Return of auto generated keys is not yet supported.
void
releaseSavepoint(Savepoint savepoint)
void
rollback()
It's not legal to do a rollback within a call from SQL.
void
rollback(Savepoint savepoint)
void
setAutoCommit(boolean autoCommit)
It is assumed that an SPI call is under transaction control.
void
setCatalog(String catalog)
The catalog name cannot be set.
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.
Savepoint
setSavepoint()
Savepoint
setSavepoint(String name)
void
setTransactionIsolation(int level)
Change of transaction isolation level is not supported.
void
setTypeMap(Map map)
Type map is not yet implemented.

Field Details

JDBC3_TYPE_NAMES

public static final String[] JDBC3_TYPE_NAMES

JDBC_TYPE_NUMBERS

public static final int[] JDBC_TYPE_NUMBERS

Method Details

clearWarnings

public void clearWarnings()
            throws SQLException
Warnings are not yet supported.

close

public void close()
            throws SQLException
This is a no-op. The default connection never closes.

commit

public void commit()
            throws SQLException
It's not legal to do a commit within a call from SQL.

createStatement

public Statement createStatement()
            throws SQLException
Creates a new instance of SPIStatement.

createStatement

public Statement createStatement(int resultSetType,
                                 int resultSetConcurrency)
            throws SQLException
Creates a new instance of SPIStatement.

createStatement

public Statement createStatement(int resultSetType,
                                 int resultSetConcurrency,
                                 int resultSetHoldability)
            throws SQLException
Creates a new instance of SPIStatement.

getAutoCommit

public boolean getAutoCommit()
            throws SQLException
It is assumed that an SPI call is under transaction control. This method will always return false.

getCatalog

public String getCatalog()
            throws SQLException
Returns null.

getDefault

public static Connection getDefault()
            throws SQLException
Returns a default connection instance. It is the callers responsability to close this instance.

getHoldability

public int getHoldability()
            throws SQLException
Returns ResultSet.CLOSE_CURSORS_AT_COMMIT. Cursors are actually closed when a function returns to SQL.

getMetaData

public DatabaseMetaData getMetaData()
            throws SQLException
DatabaseMetaData is not yet supported.

getPGType

public String getPGType(Oid oid)
            throws SQLException

getSQLType

public int getSQLType(String pgTypeName)

getSQLType

public int getSQLType(Oid oid)
            throws SQLException

getTransactionIsolation

public int getTransactionIsolation()
            throws SQLException
Returns Connection.TRANSACTION_READ_COMMITTED.

getTypeMap

public Map getTypeMap()
            throws SQLException
Returns null. Type map is not yet imlemented.

getVersionNumber

public int[] getVersionNumber()
            throws SQLException

getWarnings

public SQLWarning getWarnings()
            throws SQLException
Warnings are not yet supported.

isClosed

public boolean isClosed()
            throws SQLException
Will always return false.

isReadOnly

public boolean isReadOnly()
            throws SQLException
Returns false. The SPIConnection is not real-only.

nativeSQL

public String nativeSQL(String sql)
            throws SQLException
Parse the JDBC SQL into PostgreSQL.

nativeSQL

public String nativeSQL(String sql,
                        int[] paramCountRet)

prepareCall

public CallableStatement prepareCall(String sql)
            throws SQLException
Procedure calls are not yet implemented.

prepareCall

public CallableStatement prepareCall(String sql,
                                     int resultSetType,
                                     int resultSetConcurrency)
            throws SQLException
Procedure calls are not yet implemented.

prepareCall

public CallableStatement prepareCall(String sql,
                                     int resultSetType,
                                     int resultSetConcurrency,
                                     int resultSetHoldability)
            throws SQLException
Procedure calls are not yet implemented.

prepareStatement

public PreparedStatement prepareStatement(String sql)
            throws SQLException
Creates a new instance of SPIPreparedStatement.

prepareStatement

public PreparedStatement prepareStatement(String sql,
                                          String[] columnNames)
            throws SQLException
Return of auto generated keys is not yet supported.

prepareStatement

public PreparedStatement prepareStatement(String sql,
                                          int autoGeneratedKeys)
            throws SQLException
Return of auto generated keys is not yet supported.

prepareStatement

public PreparedStatement prepareStatement(String sql,
                                          int resultSetType,
                                          int resultSetConcurrency)
            throws SQLException
Creates a new instance of SPIPreparedStatement.

prepareStatement

public PreparedStatement prepareStatement(String sql,
                                          int resultSetType,
                                          int resultSetConcurrency,
                                          int resultSetHoldability)
            throws SQLException
Creates a new instance of SPIPreparedStatement.

prepareStatement

public PreparedStatement prepareStatement(String sql,
                                          int[] columnIndexes)
            throws SQLException
Return of auto generated keys is not yet supported.

releaseSavepoint

public void releaseSavepoint(Savepoint savepoint)
            throws SQLException

rollback

public void rollback()
            throws SQLException
It's not legal to do a rollback within a call from SQL.

rollback

public void rollback(Savepoint savepoint)
            throws SQLException

setAutoCommit

public void setAutoCommit(boolean autoCommit)
            throws SQLException
It is assumed that an SPI call is under transaction control. Changing that is not supported.

setCatalog

public void setCatalog(String catalog)
            throws SQLException
The catalog name cannot be set.

setHoldability

public void setHoldability(int holdability)
            throws SQLException
Change of holdability is not supported.

setReadOnly

public void setReadOnly(boolean readOnly)
            throws SQLException
It is assumed that an inserts and updates can be performed using and SPIConnection. Changing that is not supported.

setSavepoint

public Savepoint setSavepoint()
            throws SQLException

setSavepoint

public Savepoint setSavepoint(String name)
            throws SQLException

setTransactionIsolation

public void setTransactionIsolation(int level)
            throws SQLException
Change of transaction isolation level is not supported.

setTypeMap

public void setTypeMap(Map map)
            throws SQLException
Type map is not yet implemented.

Copyright (c) 2003, 2004, 2005 TADA AB - Taby Sweden. \ Distributed under the terms shown in COPYRIGHT