PreparedStatement Class Reference

A precompiled SQL statement that can be efficiently executed multiple times. More...

#include <SQLDatabase.h++>

Collaboration diagram for PreparedStatement:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ~PreparedStatement () throw ()
 Destructor.
void reset () throw (SQLException)
 Reset the statement so that it can be executed again.
String toSQL () throw (SQLException)
 Get the SQL statement represented by this PreparedStatement.
void bind (uint_t index) throw (SQLException)
 Bind a null value to the designated parameter in the statement.
void bind (const String &name) throw (SQLException)
 Bind a null value to the designated parameter in the statement.
void bind (uint_t index, int value) throw (SQLException)
 Bind an integer value to the designated parameter in the statement.
void bind (const String &name, int value) throw (SQLException)
 Bind an integer value to the designated parameter in the statement.
void bind (uint_t index, const int64_t &value) throw (SQLException)
 Bind a 64-bit integer value to the designated parameter in the statement.
void bind (const String &name, const int64_t &value) throw (SQLException)
 Bind a 64-bit integer value to the designated parameter in the statement.
void bind (uint_t index, const double &value) throw (SQLException)
 Bind a double-precision floating point value to the designated parameter in the statement.
void bind (const String &name, const double &value) throw (SQLException)
 Bind a double-precision floating point value to the designated parameter in the statement.
void bind (uint_t index, const String &value) throw (SQLException)
 Bind a String value to the designated parameter in the statement.
void bind (const String &name, const String &value) throw (SQLException)
 Bind a String value to the designated parameter in the statement.
void bind (uint_t index, const Blob &value) throw (SQLException)
 Bind a Blob value to the designated parameter in the statement.
void bind (const String &name, const Blob &value) throw (SQLException)
 Bind a Blob value to the designated parameter in the statement.
void clear () throw (SQLException)
 Clear the parameter value bindings for the statement.
uint_t getParameterCount () throw (SQLException)
 Returns the number of parameters in the statement.
SharedPtr< ResultSetexecute () throw (SQLException, InterruptedException)
 Execute the statement.

Friends

class SQLDatabase
class ResultSet

Detailed Description

A precompiled SQL statement that can be efficiently executed multiple times.

Author:
Mark Lindner

Constructor & Destructor Documentation

~PreparedStatement (  )  throw ()

Destructor.


Member Function Documentation

void bind ( const String name,
const Blob value 
) throw (SQLException)

Bind a Blob value to the designated parameter in the statement.

Parameters:
name The name of the parameter.
value The value to bind.
Exceptions:
SQLException If a database error occurs.
void bind ( uint_t  index,
const Blob value 
) throw (SQLException)

Bind a Blob value to the designated parameter in the statement.

Parameters:
index The index of the parameter (where 1 refers to the first parameter).
value The value to bind.
Exceptions:
SQLException If a database error occurs.
void bind ( const String name,
const String value 
) throw (SQLException)

Bind a String value to the designated parameter in the statement.

Parameters:
name The name of the parameter.
value The value to bind.
Exceptions:
SQLException If a database error occurs.
void bind ( uint_t  index,
const String value 
) throw (SQLException)

Bind a String value to the designated parameter in the statement.

Parameters:
index The index of the parameter (where 1 refers to the first parameter).
value The value to bind.
Exceptions:
SQLException If a database error occurs.
void bind ( const String name,
const double &  value 
) throw (SQLException)

Bind a double-precision floating point value to the designated parameter in the statement.

Parameters:
name The name of the parameter.
value The value to bind.
Exceptions:
SQLException If a database error occurs.
void bind ( uint_t  index,
const double &  value 
) throw (SQLException)

Bind a double-precision floating point value to the designated parameter in the statement.

Parameters:
index The index of the parameter (where 1 refers to the first parameter).
value The value to bind.
Exceptions:
SQLException If a database error occurs.
void bind ( const String name,
const int64_t &  value 
) throw (SQLException)

Bind a 64-bit integer value to the designated parameter in the statement.

Parameters:
name The name of the parameter.
value The value to bind.
Exceptions:
SQLException If a database error occurs.
void bind ( uint_t  index,
const int64_t &  value 
) throw (SQLException)

Bind a 64-bit integer value to the designated parameter in the statement.

Parameters:
index The index of the parameter (where 1 refers to the first parameter).
value The value to bind.
Exceptions:
SQLException If a database error occurs.
void bind ( const String name,
int  value 
) throw (SQLException)

Bind an integer value to the designated parameter in the statement.

Parameters:
name The name of the parameter.
value The value to bind.
Exceptions:
SQLException If a database error occurs.
void bind ( uint_t  index,
int  value 
) throw (SQLException)

Bind an integer value to the designated parameter in the statement.

Parameters:
index The index of the parameter (where 1 refers to the first parameter).
value The value to bind.
Exceptions:
SQLException If a database error occurs.
void bind ( const String name  )  throw (SQLException)

Bind a null value to the designated parameter in the statement.

Parameters:
name The name of the parameter.
Exceptions:
SQLException If a database error occurs.
void bind ( uint_t  index  )  throw (SQLException)

Bind a null value to the designated parameter in the statement.

Parameters:
index The index of the parameter (where 1 refers to the first parameter).
Exceptions:
SQLException If a database error occurs.
void clear (  )  throw (SQLException)

Clear the parameter value bindings for the statement.

Exceptions:
SQLException If a database error occurs.

Execute the statement.

Returns:
A shared pointer to the ResultSet object which represents the (possibly empty) results.
Exceptions:
SQLException If a database error occurs.
InterruptedException If the operation was interrupted via a call to SQLDatabase::interrupt().
uint_t getParameterCount (  )  throw (SQLException)

Returns the number of parameters in the statement.

Exceptions:
SQLException If a database error occurs.
void reset (  )  throw (SQLException)

Reset the statement so that it can be executed again.

Exceptions:
SQLException If a database error occurs.
String toSQL (  )  throw (SQLException)

Get the SQL statement represented by this PreparedStatement.

Returns:
The SQL statement, as a String.
Exceptions:
SQLException If a database error occurs.

Friends And Related Function Documentation

friend class ResultSet [friend]
friend class SQLDatabase [friend]

The documentation for this class was generated from the following files:
Generated on Fri Sep 3 23:49:37 2010 for libcommonc++ by  doxygen 1.6.3