com.sybase.jdbcx
Interface SybStatement

All Known Subinterfaces:
SybCallableStatement, SybPreparedStatement

public abstract interface SybStatement
extends Statement

Sybase implementation of the Statement interface.

Some methods in this interface are part of the JDBC 2.0 standard, available in jConnect 5.0. However, jConnect 4.1 provides them as Sybase-specific extensions to JDBC 1.0. They can be accessed only by casting the Statement object to a SybStatement.

See Also:
Statement, Connection.createStatement(), ResultSet

Method Summary
 Connection getConnection()
           JDBC 2.0 API - Returns the Connection that produced the Statement.
 int getFetchSize()
           JDBC 2.0 API - Queries statement's fetch size for a cursored select.
 int getResultSetConcurrency()
           JDBC 2.0 API - Returns the concurrency setting for the select statement.
 SybMessageHandler getSybMessageHandler()
          Returns current message handler object for this Statement.
 void setCursorName(String name)
           JDBC 1.0 API - Enables statement's query to declare a cursor at the database server.
 void setFetchSize(int numRows)
           JDBC 2.0 API - Sets the number of rows to fetch at a time and indicates that the statement should be declared as a cursor on the database server when it is executed.
 void setSybMessageHandler(SybMessageHandler msgHandler)
          Sets the message handler for this statement.
 
Methods inherited from interface java.sql.Statement
addBatch, cancel, clearBatch, clearWarnings, close, execute, executeBatch, executeQuery, executeUpdate, getFetchDirection, getMaxFieldSize, getMaxRows, getMoreResults, getQueryTimeout, getResultSet, getResultSetType, getUpdateCount, getWarnings, setEscapeProcessing, setFetchDirection, setMaxFieldSize, setMaxRows, setQueryTimeout
 

Method Detail

getConnection

public Connection getConnection()
                                  throws SQLException

JDBC 2.0 API - Returns the Connection that produced the Statement.

Specified by:
getConnection in interface Statement
Returns:
SybConnection object cast as Connection
Throws:
SQLException - if a database-access error occurs
See Also:
Statement.getConnection()

getFetchSize

public int getFetchSize()
                 throws SQLException

JDBC 2.0 API - Queries statement's fetch size for a cursored select. If a cursor is not specified for the statement, 0 is returned. This indicates that a select operation will not declare a cursor and the entire row result set will be fetched.

Specified by:
getFetchSize in interface Statement
Returns:
the fetch size.
Throws:
SQLException - if a database-access error occurs
See Also:
Statement.getFetchSize()

getSybMessageHandler

public SybMessageHandler getSybMessageHandler()
Returns current message handler object for this Statement.
Returns:
the message handler

getResultSetConcurrency

public int getResultSetConcurrency()
                            throws SQLException

JDBC 2.0 API - Returns the concurrency setting for the select statement. If the statement does not declare a database cursor for the query, 0 is returned.

Specified by:
getResultSetConcurrency in interface Statement
Returns:
concurrency setting
Throws:
SQLException - if a database-access error occurs
See Also:
Statement.getResultSetConcurrency(), com.sybase.jdbc2.jdbc.SybCursorResultSet

setCursorName

public void setCursorName(String name)
                   throws SQLException

JDBC 1.0 API - Enables statement's query to declare a cursor at the database server. This method must be called before the query is executed.

Specified by:
setCursorName in interface Statement
Throws:
SQLException - if a database-access error occurs
See Also:
Statement.setCursorName(java.lang.String)

setFetchSize

public void setFetchSize(int numRows)
                  throws SQLException

JDBC 2.0 API - Sets the number of rows to fetch at a time and indicates that the statement should be declared as a cursor on the database server when it is executed. This method sets the number of rows that should be sent from the server to the client in batch fetches. ResultSet.next still moves through the rows one at a time, but each next call does not necessarily result in an interaction with the database.

Specified by:
setFetchSize in interface Statement
Parameters:
numRows - number of rows per fetch
Throws:
SQLException - if a database-access error occurs
See Also:
Statement.setFetchSize(int), SybCursorResultSet

setSybMessageHandler

public void setSybMessageHandler(SybMessageHandler msgHandler)
Sets the message handler for this statement.
Parameters:
msgHandler - message handler to be called when an error occurs; null turns off error callbacks