|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.jtds.jdbcx.proxy.StatementProxy
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.
Field Summary | |
private ConnectionProxy |
_connection
|
private JtdsStatement |
_statement
|
Fields inherited from interface java.sql.Statement |
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO |
Constructor Summary | |
(package private) |
StatementProxy(ConnectionProxy connection,
JtdsStatement statement)
|
Method Summary | |
void |
addBatch(java.lang.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(java.lang.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(java.lang.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(java.lang.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. |
boolean |
execute(java.lang.String sql,
java.lang.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[] |
executeBatch()
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners. |
java.sql.ResultSet |
executeQuery(java.lang.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(java.lang.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(java.lang.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(java.lang.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 |
executeUpdate(java.lang.String sql,
java.lang.String[] columnNames)
Delgates calls to the statement; SQLExceptions thrown from the statement will cause an event to be fired on the connection pool listeners. |
java.sql.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. |
java.sql.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. |
java.sql.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. |
java.sql.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(java.sql.SQLException sqlException)
Processes SQLExceptions. |
void |
setCursorName(java.lang.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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private ConnectionProxy _connection
private JtdsStatement _statement
Constructor Detail |
StatementProxy(ConnectionProxy connection, JtdsStatement statement)
Method Detail |
public java.sql.ResultSet executeQuery(java.lang.String sql) throws java.sql.SQLException
executeQuery
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic int executeUpdate(java.lang.String sql) throws java.sql.SQLException
executeUpdate
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic void close() throws java.sql.SQLException
close
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic int getMaxFieldSize() throws java.sql.SQLException
getMaxFieldSize
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic void setMaxFieldSize(int max) throws java.sql.SQLException
setMaxFieldSize
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic int getMaxRows() throws java.sql.SQLException
getMaxRows
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic void setMaxRows(int max) throws java.sql.SQLException
setMaxRows
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic void setEscapeProcessing(boolean enable) throws java.sql.SQLException
setEscapeProcessing
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic int getQueryTimeout() throws java.sql.SQLException
getQueryTimeout
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic void setQueryTimeout(int seconds) throws java.sql.SQLException
setQueryTimeout
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic void cancel() throws java.sql.SQLException
cancel
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic java.sql.SQLWarning getWarnings() throws java.sql.SQLException
getWarnings
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic void clearWarnings() throws java.sql.SQLException
clearWarnings
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic void setCursorName(java.lang.String name) throws java.sql.SQLException
setCursorName
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic boolean execute(java.lang.String sql) throws java.sql.SQLException
execute
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic java.sql.ResultSet getResultSet() throws java.sql.SQLException
getResultSet
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic int getUpdateCount() throws java.sql.SQLException
getUpdateCount
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic boolean getMoreResults() throws java.sql.SQLException
getMoreResults
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic void setFetchDirection(int direction) throws java.sql.SQLException
setFetchDirection
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic int getFetchDirection() throws java.sql.SQLException
getFetchDirection
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic void setFetchSize(int rows) throws java.sql.SQLException
setFetchSize
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic int getFetchSize() throws java.sql.SQLException
getFetchSize
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic int getResultSetConcurrency() throws java.sql.SQLException
getResultSetConcurrency
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic int getResultSetType() throws java.sql.SQLException
getResultSetType
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic void addBatch(java.lang.String sql) throws java.sql.SQLException
addBatch
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic void clearBatch() throws java.sql.SQLException
clearBatch
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic int[] executeBatch() throws java.sql.SQLException
executeBatch
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic boolean getMoreResults(int current) throws java.sql.SQLException
getMoreResults
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic java.sql.ResultSet getGeneratedKeys() throws java.sql.SQLException
getGeneratedKeys
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic int executeUpdate(java.lang.String sql, int autoGeneratedKeys) throws java.sql.SQLException
executeUpdate
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic int executeUpdate(java.lang.String sql, int[] columnIndexes) throws java.sql.SQLException
executeUpdate
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic int executeUpdate(java.lang.String sql, java.lang.String[] columnNames) throws java.sql.SQLException
executeUpdate
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic boolean execute(java.lang.String sql, int autoGeneratedKeys) throws java.sql.SQLException
execute
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic boolean execute(java.lang.String sql, int[] columnIndexes) throws java.sql.SQLException
execute
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic boolean execute(java.lang.String sql, java.lang.String[] columnNames) throws java.sql.SQLException
execute
in interface java.sql.Statement
java.sql.SQLException
- if an error occurspublic int getResultSetHoldability() throws java.sql.SQLException
getResultSetHoldability
in interface java.sql.Statement
java.sql.SQLException
- if an error occursprotected void validateConnection() throws java.sql.SQLException
java.sql.SQLException
protected void processSQLException(java.sql.SQLException sqlException) throws java.sql.SQLException
java.sql.SQLException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |