odbc::Statement Class Reference

Inheritance diagram for odbc::Statement:

odbc::ErrorHandler odbc::ErrorHandler odbc::PreparedStatement odbc::PreparedStatement odbc::CallableStatement odbc::CallableStatement odbc::CallableStatement odbc::CallableStatement List of all members.

Detailed Description

A simple non-prepared statement.

Definition at line 36 of file statement.h.

Public Member Functions

void cancel ()
 Cancel an ongoing operation that was executed in another thread.
void cancel ()
 Cancel an ongoing operation that was executed in another thread.
void close ()
 Closes all result sets from this execution.
void close ()
 Closes all result sets from this execution.
virtual bool execute (const ODBCXX_STRING &sql)
 Execute a given SQL statement.
virtual bool execute (const ODBCXX_STRING &sql)
 Execute a given SQL statement.
virtual ResultSetexecuteQuery (const ODBCXX_STRING &sql)
 Execute an SQL statement, expected to return a resultset.
virtual ResultSetexecuteQuery (const ODBCXX_STRING &sql)
 Execute an SQL statement, expected to return a resultset.
virtual int executeUpdate (const ODBCXX_STRING &sql)
 Execute an SQL statement, expected to return an update count.
virtual int executeUpdate (const ODBCXX_STRING &sql)
 Execute an SQL statement, expected to return an update count.
ConnectiongetConnection ()
 Returns the connection that created this statement.
ConnectiongetConnection ()
 Returns the connection that created this statement.
bool getEscapeProcessing ()
 Gets the current escape processing setting.
bool getEscapeProcessing ()
 Gets the current escape processing setting.
int getFetchSize ()
 Fetch the current fetch size (also called rowset size) for resultsets created by this statement.
int getFetchSize ()
 Fetch the current fetch size (also called rowset size) for resultsets created by this statement.
int getMaxFieldSize ()
 Get the maximum field size for resultsets create by this statement.
int getMaxFieldSize ()
 Get the maximum field size for resultsets create by this statement.
int getMaxRows ()
 Get the maximum number of rows to return in a resultset.
int getMaxRows ()
 Get the maximum number of rows to return in a resultset.
bool getMoreResults ()
 Check if there are more results available on this statment.
bool getMoreResults ()
 Check if there are more results available on this statment.
int getQueryTimeout ()
 Get the query timeout for this statement.
int getQueryTimeout ()
 Get the query timeout for this statement.
ResultSetgetResultSet ()
 Fetch the current result as a ResultSet.
ResultSetgetResultSet ()
 Fetch the current result as a ResultSet.
int getResultSetConcurrency ()
 Get the concurrency type for resultsets created by this statement.
int getResultSetConcurrency ()
 Get the concurrency type for resultsets created by this statement.
int getResultSetType ()
 Get the type for resultsets created by this statement.
int getResultSetType ()
 Get the type for resultsets created by this statement.
int getUpdateCount ()
 Fetch the current result as an update count.
int getUpdateCount ()
 Fetch the current result as an update count.
void setCursorName (const ODBCXX_STRING &name)
 Set the cursor name for this statement.
void setCursorName (const ODBCXX_STRING &name)
 Set the cursor name for this statement.
void setEscapeProcessing (bool on)
 Sets escape processing on or off.
void setEscapeProcessing (bool on)
 Sets escape processing on or off.
void setFetchSize (int size)
 Set the current fetch size for resultsets created by this statement.
void setFetchSize (int size)
 Set the current fetch size for resultsets created by this statement.
void setMaxFieldSize (int maxFieldSize)
 Set the maximum field size for resultsets create by this statement.
void setMaxFieldSize (int maxFieldSize)
 Set the maximum field size for resultsets create by this statement.
void setMaxRows (int maxRows)
 Set the maximum number of rows to return in a resultset.
void setMaxRows (int maxRows)
 Set the maximum number of rows to return in a resultset.
void setQueryTimeout (int seconds)
 Set the query timeout for this statement.
void setQueryTimeout (int seconds)
 Set the query timeout for this statement.
virtual ~Statement ()
 Destructor.
virtual ~Statement ()
 Destructor.

Protected Member Functions

const DriverInfo * _getDriverInfo () const
const DriverInfo * _getDriverInfo () const

Protected Attributes

Connectionconnection_
Connectionconnection_
SQLHSTMT hstmt_
int lastExecute_


Constructor & Destructor Documentation

virtual odbc::Statement::~Statement (  )  [virtual]

Destructor.

Destroys/closes this statement as well as all created resultsets.

virtual odbc::Statement::~Statement (  )  [virtual]

Destructor.

Destroys/closes this statement as well as all created resultsets.


Member Function Documentation

void odbc::Statement::close (  ) 

Closes all result sets from this execution.

This is useful if you don't wish to iterate through all remaining results, or if your driver does not auto-close cursors.

void odbc::Statement::close (  ) 

Closes all result sets from this execution.

This is useful if you don't wish to iterate through all remaining results, or if your driver does not auto-close cursors.

virtual bool odbc::Statement::execute ( const ODBCXX_STRING &  sql  )  [virtual]

Execute a given SQL statement.

The statement can return multiple results. To get to the next result after processing the first one, getMoreResults() should be called.

Parameters:
sql The string to execute
Returns:
true if a resultset is available

virtual bool odbc::Statement::execute ( const ODBCXX_STRING &  sql  )  [virtual]

Execute a given SQL statement.

The statement can return multiple results. To get to the next result after processing the first one, getMoreResults() should be called.

Parameters:
sql The string to execute
Returns:
true if a resultset is available

virtual ResultSet* odbc::Statement::executeQuery ( const ODBCXX_STRING &  sql  )  [virtual]

Execute an SQL statement, expected to return a resultset.

Example: std::auto_ptr<ResultSet> rs = std::auto_ptr<ResultSet>(stmt->executeQuery(s));

Parameters:
sql The string to execute
Returns:
A ResultSet object.

virtual ResultSet* odbc::Statement::executeQuery ( const ODBCXX_STRING &  sql  )  [virtual]

Execute an SQL statement, expected to return a resultset.

Example: std::auto_ptr<ResultSet> rs = std::auto_ptr<ResultSet>(stmt->executeQuery(s));

Parameters:
sql The string to execute
Returns:
A ResultSet object.

virtual int odbc::Statement::executeUpdate ( const ODBCXX_STRING &  sql  )  [virtual]

Execute an SQL statement, expected to return an update count.

Returns:
The number of affected rows

virtual int odbc::Statement::executeUpdate ( const ODBCXX_STRING &  sql  )  [virtual]

Execute an SQL statement, expected to return an update count.

Returns:
The number of affected rows

bool odbc::Statement::getEscapeProcessing (  ) 

Gets the current escape processing setting.

Returns:
true if escape processing is on, false otherwise

bool odbc::Statement::getEscapeProcessing (  ) 

Gets the current escape processing setting.

Returns:
true if escape processing is on, false otherwise

bool odbc::Statement::getMoreResults (  ) 

Check if there are more results available on this statment.

Returns:
True if this statement has more results to offer.

bool odbc::Statement::getMoreResults (  ) 

Check if there are more results available on this statment.

Returns:
True if this statement has more results to offer.

int odbc::Statement::getUpdateCount (  ) 

Fetch the current result as an update count.

Returns:
the current result's update count (affected rows), or -1 if the result is a ResultSet or if there are no more results.

int odbc::Statement::getUpdateCount (  ) 

Fetch the current result as an update count.

Returns:
the current result's update count (affected rows), or -1 if the result is a ResultSet or if there are no more results.

void odbc::Statement::setEscapeProcessing ( bool  on  ) 

Sets escape processing on or off.

For PreparedStatements, the command has been parsed on creation, so this setting won't really have any effect.

void odbc::Statement::setEscapeProcessing ( bool  on  ) 

Sets escape processing on or off.

For PreparedStatements, the command has been parsed on creation, so this setting won't really have any effect.


The documentation for this class was generated from the following files:
GridLAB-DTM Version 1.0
An open-source project initiated by the US Department of Energy