net.sourceforge.jtds.jdbcx.proxy

Class StatementProxy

Implemented Interfaces:
Statement
Known Direct Subclasses:
PreparedStatementProxy

public class StatementProxy
extends java.lang.Object
implements Statement

This class would be better implemented as a java.lang.reflect.Proxy. However, this feature was not added until 1.3 and reflection performance was not improved until 1.4. Since the driver still needs to be compatible with 1.2 and 1.3 this class is used to delegate the calls to a statement with minimal overhead.
Version:
$Id: StatementProxy.java,v 1.4 2004/08/24 17:45:08 bheineman Exp $

Field Summary

private ConnectionProxy
_connection
private JtdsStatement
_statement

Constructor Summary

StatementProxy(ConnectionProxy connection, JtdsStatement statement)

Method Summary

void
addBatch(String sql)
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.
void
cancel()
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.
void
clearBatch()
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.
void
clearWarnings()
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.
void
close()
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.
boolean
execute(String sql)
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.
boolean
execute(String sql, String[] columnNames)
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.
boolean
execute(String sql, int autoGeneratedKeys)
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.
boolean
execute(String sql, int[] columnIndexes)
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.
int[]
executeBatch()
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.
ResultSet
executeQuery(String sql)
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.
int
executeUpdate(String sql)
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.
int
executeUpdate(String sql, String[] columnNames)
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.
int
executeUpdate(String sql, int autoGeneratedKeys)
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.
int
executeUpdate(String sql, int[] columnIndexes)
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.
Connection
getConnection()
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.
int
getFetchDirection()
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.
int
getFetchSize()
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.
ResultSet
getGeneratedKeys()
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.
int
getMaxFieldSize()
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.
int
getMaxRows()
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.
boolean
getMoreResults()
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.
boolean
getMoreResults(int current)
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.
int
getQueryTimeout()
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.
ResultSet
getResultSet()
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.
int
getResultSetConcurrency()
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.
int
getResultSetHoldability()
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.
int
getResultSetType()
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.
int
getUpdateCount()
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.
SQLWarning
getWarnings()
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.
protected void
processSQLException(SQLException sqlException)
Processes SQLExceptions.
void
setCursorName(String name)
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.
void
setEscapeProcessing(boolean enable)
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.
void
setFetchDirection(int direction)
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.
void
setFetchSize(int rows)
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.
void
setMaxFieldSize(int max)
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.
void
setMaxRows(int max)
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.
void
setQueryTimeout(int seconds)
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.
protected void
validateConnection()
Validates the connection state.

Field Details

_connection

private ConnectionProxy _connection

_statement

private JtdsStatement _statement

Constructor Details

StatementProxy

(package private)  StatementProxy(ConnectionProxy connection,
                                  JtdsStatement statement)

Method Details

addBatch

public void addBatch(String sql)
            throws SQLException
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.

cancel

public void cancel()
            throws SQLException
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.

clearBatch

public void clearBatch()
            throws SQLException
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.

clearWarnings

public void clearWarnings()
            throws SQLException
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.

close

public void close()
            throws SQLException
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.

execute

public boolean execute(String sql)
            throws SQLException
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.

execute

public boolean execute(String sql,
                       String[] columnNames)
            throws SQLException
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.

execute

public boolean execute(String sql,
                       int autoGeneratedKeys)
            throws SQLException
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.

execute

public boolean execute(String sql,
                       int[] columnIndexes)
            throws SQLException
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.

executeBatch

public int[] executeBatch()
            throws SQLException
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.

executeQuery

public ResultSet executeQuery(String sql)
            throws SQLException
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.

executeUpdate

public int executeUpdate(String sql)
            throws SQLException
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.

executeUpdate

public int executeUpdate(String sql,
                         String[] columnNames)
            throws SQLException
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.

executeUpdate

public int executeUpdate(String sql,
                         int autoGeneratedKeys)
            throws SQLException
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.

executeUpdate

public int executeUpdate(String sql,
                         int[] columnIndexes)
            throws SQLException
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.

getConnection

public Connection getConnection()
            throws SQLException
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.

getFetchDirection

public int getFetchDirection()
            throws SQLException
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.

getFetchSize

public int getFetchSize()
            throws SQLException
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.

getGeneratedKeys

public ResultSet getGeneratedKeys()
            throws SQLException
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.

getMaxFieldSize

public int getMaxFieldSize()
            throws SQLException
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.

getMaxRows

public int getMaxRows()
            throws SQLException
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.

getMoreResults

public boolean getMoreResults()
            throws SQLException
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.

getMoreResults

public boolean getMoreResults(int current)
            throws SQLException
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.

getQueryTimeout

public int getQueryTimeout()
            throws SQLException
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.

getResultSet

public ResultSet getResultSet()
            throws SQLException
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.

getResultSetConcurrency

public int getResultSetConcurrency()
            throws SQLException
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.

getResultSetHoldability

public int getResultSetHoldability()
            throws SQLException
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.

getResultSetType

public int getResultSetType()
            throws SQLException
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.

getUpdateCount

public int getUpdateCount()
            throws SQLException
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.

getWarnings

public SQLWarning getWarnings()
            throws SQLException
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.

processSQLException

protected void processSQLException(SQLException sqlException)
            throws SQLException
Processes SQLExceptions.

setCursorName

public void setCursorName(String name)
            throws SQLException
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.

setEscapeProcessing

public void setEscapeProcessing(boolean enable)
            throws SQLException
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.

setFetchDirection

public void setFetchDirection(int direction)
            throws SQLException
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.

setFetchSize

public void setFetchSize(int rows)
            throws SQLException
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.

setMaxFieldSize

public void setMaxFieldSize(int max)
            throws SQLException
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.

setMaxRows

public void setMaxRows(int max)
            throws SQLException
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.

setQueryTimeout

public void setQueryTimeout(int seconds)
            throws SQLException
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners.

validateConnection

protected void validateConnection()
            throws SQLException
Validates the connection state.

Generated on June 12 2008