Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
odbc::CallableStatement Class Reference

#include <RDBC/blob/master/include/RDBC/odbc++/callablestatement.h>

+ Inheritance diagram for odbc::CallableStatement:
+ Collaboration diagram for odbc::CallableStatement:

Public Member Functions

virtual ~CallableStatement ()
 
double getDouble (int idx)
 
bool getBoolean (int idx)
 
signed char getByte (int idx)
 
ODBCXX_BYTES getBytes (int idx)
 
Date getDate (int idx)
 
float getFloat (int idx)
 
int getInt (int idx)
 
Long getLong (int idx)
 
short getShort (int idx)
 
ODBCXX_STRING getString (int idx)
 
Time getTime (int idx)
 
Timestamp getTimestamp (int idx)
 
void registerOutParameter (int idx, int sqlType)
 
void registerOutParameter (int idx, int sqlType, int scale)
 
bool wasNull ()
 
- Public Member Functions inherited from odbc::PreparedStatement
virtual ~PreparedStatement ()
 
void clearParameters ()
 
bool execute ()
 
ResultSetexecuteQuery ()
 
int executeUpdate ()
 
bool execute (const ODBCXX_STRING &)
 
ResultSetexecuteQuery (const ODBCXX_STRING &)
 
int executeUpdate (const ODBCXX_STRING &)
 
void setDouble (int idx, double val)
 
void setBoolean (int idx, bool val)
 
void setByte (int idx, signed char val)
 
void setBytes (int idx, const ODBCXX_BYTES &val)
 
void setDate (int idx, const Date &val)
 
void setFloat (int idx, float val)
 
void setInt (int idx, int val)
 
void setLong (int idx, Long val)
 
void setShort (int idx, short val)
 
void setString (int idx, const ODBCXX_STRING &val)
 
void setTime (int idx, const Time &val)
 
void setTimestamp (int idx, const Timestamp &val)
 
void setAsciiStream (int idx, ODBCXX_STREAM *s, int len)
 
void setBinaryStream (int idx, ODBCXX_STREAM *s, int len)
 
void setNull (int idx, int sqlType)
 
- Public Member Functions inherited from odbc::Statement
virtual ~Statement ()
 
ConnectiongetConnection ()
 
void cancel ()
 
int getUpdateCount ()
 
ResultSetgetResultSet ()
 
bool getMoreResults ()
 
void setCursorName (const ODBCXX_STRING &name)
 
int getFetchSize ()
 
void setFetchSize (int size)
 
int getResultSetConcurrency ()
 
int getResultSetType ()
 
int getQueryTimeout ()
 
void setQueryTimeout (int seconds)
 
int getMaxRows ()
 
void setMaxRows (int maxRows)
 
int getMaxFieldSize ()
 
void setMaxFieldSize (int maxFieldSize)
 
void setEscapeProcessing (bool on)
 
bool getEscapeProcessing ()
 
- Public Member Functions inherited from odbc::ErrorHandler
void clearWarnings ()
 
WarningListgetWarnings ()
 
virtual ~ErrorHandler ()
 

Protected Member Functions

 CallableStatement (Connection *con, SQLHSTMT hstmt, const ODBCXX_STRING &sql, int resultSetType, int resultSetConcurrency)
 
- Protected Member Functions inherited from odbc::PreparedStatement
 PreparedStatement (Connection *con, SQLHSTMT hstmt, const ODBCXX_STRING &sql, int resultSetType, int resultSetConcurrency, int defaultDirection=SQL_PARAM_INPUT)
 
void _bindParams ()
 
void _unbindParams ()
 
void _checkParam (int idx, int *allowed, int numAllowed, int defPrec, int defScale)
 
- Protected Member Functions inherited from odbc::Statement
const DriverInfo * _getDriverInfo () const
 
 Statement (Connection *con, SQLHSTMT hstmt, int resultSetType, int resultSetConcurrency)
 
SQLUINTEGER _getNumericOption (SQLINTEGER optnum)
 
ODBCXX_STRING _getStringOption (SQLINTEGER optnum)
 
void _setNumericOption (SQLINTEGER optnum, SQLUINTEGER value)
 
void _setStringOption (SQLINTEGER optnum, const ODBCXX_STRING &value)
 
bool _checkForResults ()
 
ResultSet_getResultSet (bool hideMe=false)
 
void _beforeExecute ()
 
void _afterExecute ()
 
- Protected Member Functions inherited from odbc::ErrorHandler
void _postWarning (SQLWarning *w)
 
void _checkErrorODBC2 (SQLHENV henv, SQLHDBC hdbc, SQLHSTMT hstmt, SQLRETURN r, const ODBCXX_STRING &what)
 
void _checkStmtError (SQLHSTMT hstmt, SQLRETURN r, const char *what="")
 
void _checkConError (SQLHDBC hdbc, SQLRETURN r, const char *what="")
 
void _checkEnvError (SQLHENV henv, SQLRETURN r, const char *what="")
 
 ErrorHandler (bool collectWarnings=true)
 

Private Attributes

bool lastWasNull_
 

Friends

class Connection
 

Additional Inherited Members

- Protected Attributes inherited from odbc::PreparedStatement
ODBCXX_STRING sql_
 
Rowset * rowset_
 
size_t numParams_
 
std::vector< int > directions_
 
int defaultDirection_
 
bool paramsBound_
 

Detailed Description

A prepared statement suited for stored procedure calls.

A CallableStatement extends the functionality of a PreparedStatement, by allowing output parameters.

The ODBC escapes for calling stored procedures and functions should be used. A procedure call is prepared like this:

CallableStatement* cstmt=con->prepareCall
    ("{call my_procedure(?,?,?)}");

And for a function call (a procedure that returns a value), the following syntax should be used:

CallableStatement* cstmt=con->prepareCall
    ("{?=call my_function(?,?)}"); 

All parameters in a CallableStatement are treated as input/output parameters, unless they are registered as output-only parameters with registerOutParameter(). Note that output-only parameters must be registered with their proper SQL type prior to executing a CallableStatement.

Definition at line 57 of file callablestatement.h.

View newest version in sPHENIX GitHub at line 57 of file callablestatement.h

Constructor & Destructor Documentation

odbc::CallableStatement::CallableStatement ( Connection con,
SQLHSTMT  hstmt,
const ODBCXX_STRING sql,
int  resultSetType,
int  resultSetConcurrency 
)
protected
virtual odbc::CallableStatement::~CallableStatement ( )
virtual

Destructor

Member Function Documentation

bool odbc::CallableStatement::getBoolean ( int  idx)

Fetches a parameter as a bool

Parameters
idxThe parameter index, starting at 1

Referenced by ODBCCallableStatement::GetBoolean().

+ Here is the caller graph for this function:

signed char odbc::CallableStatement::getByte ( int  idx)

Fetches a parameter as a signed char

Parameters
idxThe parameter index, starting at 1

Referenced by ODBCCallableStatement::GetByte().

+ Here is the caller graph for this function:

ODBCXX_BYTES odbc::CallableStatement::getBytes ( int  idx)

Fetches a parameter as a Bytes object

Parameters
idxThe parameter index, starting at 1

Referenced by ODBCCallableStatement::GetBytes().

+ Here is the caller graph for this function:

Date odbc::CallableStatement::getDate ( int  idx)

Fetches a parameter as a Date

Parameters
idxThe parameter index, starting at 1

Referenced by ODBCCallableStatement::GetDate().

+ Here is the caller graph for this function:

double odbc::CallableStatement::getDouble ( int  idx)

Fetches a parameter as a double

Parameters
idxThe parameter index, starting at 1

Referenced by ODBCCallableStatement::GetDouble().

+ Here is the caller graph for this function:

float odbc::CallableStatement::getFloat ( int  idx)

Fetches a parameter as a float

Parameters
idxThe parameter index, starting at 1

Referenced by ODBCCallableStatement::GetFloat().

+ Here is the caller graph for this function:

int odbc::CallableStatement::getInt ( int  idx)

Fetches a parameter as an int

Parameters
idxThe parameter index, starting at 1

Referenced by ODBCCallableStatement::GetInt().

+ Here is the caller graph for this function:

Long odbc::CallableStatement::getLong ( int  idx)

Fetches a parameter as a Long

Parameters
idxThe parameter index, starting at 1

Referenced by ODBCCallableStatement::GetLong().

+ Here is the caller graph for this function:

short odbc::CallableStatement::getShort ( int  idx)

Fetches a parameter as a short

Parameters
idxThe parameter index, starting at 1

Referenced by ODBCCallableStatement::GetShort().

+ Here is the caller graph for this function:

ODBCXX_STRING odbc::CallableStatement::getString ( int  idx)

Fetches a parameter as a string

Parameters
idxThe parameter index, starting at 1

Referenced by ODBCCallableStatement::GetString().

+ Here is the caller graph for this function:

Time odbc::CallableStatement::getTime ( int  idx)

Fetches a parameter as a Time

Parameters
idxThe parameter index, starting at 1

Referenced by ODBCCallableStatement::GetTime().

+ Here is the caller graph for this function:

Timestamp odbc::CallableStatement::getTimestamp ( int  idx)

Fetches a parameter as a Timestamp

Parameters
idxThe parameter index, starting at 1

Referenced by ODBCCallableStatement::GetTimestamp().

+ Here is the caller graph for this function:

void odbc::CallableStatement::registerOutParameter ( int  idx,
int  sqlType 
)
inline

Registers an output parameter

Parameters
idxThe parameter index, starting at 1
sqlTypeThe SQL type of the parameter
See Also
Types

Definition at line 139 of file callablestatement.h.

View newest version in sPHENIX GitHub at line 139 of file callablestatement.h

Referenced by ODBCCallableStatement::RegisterOutParameter().

+ Here is the caller graph for this function:

void odbc::CallableStatement::registerOutParameter ( int  idx,
int  sqlType,
int  scale 
)

Registers an output parameter with a given scale

Parameters
idxThe parameter index, starting at 1
sqlTypeThe SQL type of the parameter
scaleThe scale of the parameter.
See Also
Types
bool odbc::CallableStatement::wasNull ( )
inline

Returns true if the last fetched parameter was NULL

Definition at line 152 of file callablestatement.h.

View newest version in sPHENIX GitHub at line 152 of file callablestatement.h

Referenced by ODBCCallableStatement::WasNull().

+ Here is the caller graph for this function:

Friends And Related Function Documentation

friend class Connection
friend

Definition at line 58 of file callablestatement.h.

View newest version in sPHENIX GitHub at line 58 of file callablestatement.h

Member Data Documentation

bool odbc::CallableStatement::lastWasNull_
private

Definition at line 61 of file callablestatement.h.

View newest version in sPHENIX GitHub at line 61 of file callablestatement.h


The documentation for this class was generated from the following file: