Difference between revisions of "OpenDBX/C++ API/1.0/Stmt"

From Linuxnetworks
< OpenDBX‎ | C++ API‎ | 1.0
Jump to: navigation, search
(Stmt public types and members)
 
(~Stmt())
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Public Types ==
 
  
enum Type 
+
__NOTOC__
  
Statement objects which can be created.
+
== Public member functions ==
  
== Public Member Functions ==
+
{|
 +
|-
 +
|[[OpenDBX/C++ API/1.0/Stmt#Stmt( const Stmt & )|Stmt]] ( const Stmt & )
 +
Copy constructor.
 +
|-
 +
|Result [[OpenDBX/C++ API/1.0/Stmt#Result execute()|execute]] ()
 +
Executes a statement and returns a Result instance.
 +
|-
 +
|Stmt & [[OpenDBX/C++ API/1.0/Stmt#Stmt & operator=( const Stmt & )|operator=]] ( const Stmt & )
 +
Assigns a statement instance to another one.
 +
|-
 +
|[[OpenDBX/C++ API/1.0/Stmt#~Stmt()|~Stmt]] ()
 +
Destroys the statement instance if no other references exist.
 +
|}
 +
 
 +
== Public member description ==
 +
 
 +
=== Stmt( const Stmt & ) ===
  
 
  Stmt(
 
  Stmt(
    const Stmt &ref
+
    const Stmt & ref
 
  ) throw ()
 
  ) throw ()
  
Copy constructor.
+
Copy constructor.  
  
~Stmt() throw ()
+
Enables the transfer of the internal state of an object ref of the same type to this object. Both objects share the same variables and the reference counter afterwards. The reference counter is incremented each time an object is copied and will be decremented if it is destroyed.
  
Destroys the statement instance if no other references exist.
+
==== Parameters ====
 +
 
 +
{| class="desctable"
 +
|-
 +
| ''ref'' || Original statement object instance  
 +
|}
 +
 
 +
=== Result execute() ===
  
 
  Result execute() throw ( std::exception )
 
  Result execute() throw ( std::exception )
  
Executes a statement and returns a Result instance.
+
Executes a statement and returns a Result instance.  
 +
 
 +
Sends the necessary data to the database server which will execute the statement and return one or more result sets afterwards. The result sets can be fetched via the returned Result object.
 +
 
 +
==== Returns ====
 +
 
 +
* Result instance
 +
 
 +
==== Exceptions ====
 +
 
 +
{| class="desctable"
 +
|-
 +
| ''[[OpenDBX/C++ API/1.0/Exception|OpenDBX::Exception]]'' || If the underlying database library returns an error
 +
|}
 +
 
 +
==== See also ====
 +
 
 +
* Result
 +
 
 +
=== Stmt & operator=( const Stmt & ) ===
  
 
  Stmt & operator=(
 
  Stmt & operator=(
    const Stmt &ref
+
    const Stmt & ref
 
  ) throw ()
 
  ) throw ()
  
Assigns a statement instance to another one.
+
Assigns a statement instance to another one.
 +
 
 +
Assigns the internal state of an object ref of the same type to this object. Both objects share the same variables and the reference counter afterwards. The reference counter is incremented each time an object is copied and will be decremented if it is destroyed.
 +
 
 +
==== Parameters ====
 +
 
 +
{| class="desctable"
 +
|-
 +
| ''ref'' || Stmt instance
 +
|}
 +
 
 +
==== Returns ====
 +
 
 +
* Statement reference of this instance
 +
 
 +
=== ~Stmt() ===
 +
 
 +
~Stmt() throw ()
 +
 
 +
Destroys the statement instance if no other references exist.
 +
 
 +
Each statement object uses a reference counter to remember if the internal variables are shared with other objects. If this isn't the case or if this object is the last one referencing the variables, the object is cleaned up and the allocated memory freed.

Latest revision as of 10:03, 29 October 2009


Public member functions

Stmt ( const Stmt & )

Copy constructor.

Result execute ()

Executes a statement and returns a Result instance.

Stmt & operator= ( const Stmt & )

Assigns a statement instance to another one.

~Stmt ()

Destroys the statement instance if no other references exist.

Public member description

Stmt( const Stmt & )

Stmt(
    const Stmt & ref
) throw ()

Copy constructor.

Enables the transfer of the internal state of an object ref of the same type to this object. Both objects share the same variables and the reference counter afterwards. The reference counter is incremented each time an object is copied and will be decremented if it is destroyed.

Parameters

ref Original statement object instance

Result execute()

Result execute() throw ( std::exception )

Executes a statement and returns a Result instance.

Sends the necessary data to the database server which will execute the statement and return one or more result sets afterwards. The result sets can be fetched via the returned Result object.

Returns

  • Result instance

Exceptions

OpenDBX::Exception If the underlying database library returns an error

See also

  • Result

Stmt & operator=( const Stmt & )

Stmt & operator=(
    const Stmt & ref
) throw ()

Assigns a statement instance to another one.

Assigns the internal state of an object ref of the same type to this object. Both objects share the same variables and the reference counter afterwards. The reference counter is incremented each time an object is copied and will be decremented if it is destroyed.

Parameters

ref Stmt instance

Returns

  • Statement reference of this instance

~Stmt()

~Stmt() throw ()

Destroys the statement instance if no other references exist.

Each statement object uses a reference counter to remember if the internal variables are shared with other objects. If this isn't the case or if this object is the last one referencing the variables, the object is cleaned up and the allocated memory freed.