libgdamm Reference Documentation
Main Page   Namespaces   Book  

Gnome::Gda::Command Class Reference
[Connections and Commands]

For issuing commands to the provider. More...

List of all members.

Public Member Functions

 Command (const Glib::ustring& text, CommandType type=COMMAND_TYPE_SQL, CommandOptions options=COMMAND_OPTION_STOP_ON_ERRORS)
 Creates a new Command.
 Command (const Command& src)
 Command (GdaCommand* castitem, bool make_a_copy=false)
 Command ()
CommandType get_command_type () const
 Gets the command type of cmd .
CommandOptions get_options () const
 Gets the command options of cmd .
Glib::ustring get_text () const
 Gets the command text held by cmd .
const GdaCommand* gobj () const
GdaCommand* gobj ()
GdaCommand* gobj_copy () const
 Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs.
Commandoperator= (const Command& src)
void set_command_type (CommandType type)
 Sets the command type of cmd .
void set_options (CommandOptions options)
 Sets the command options of cmd .
void set_text (const Glib::ustring& text)
 Sets the command text of cmd .
 ~Command ()

Protected Attributes

GdaCommand* gobject_

Related Functions

(Note that these are not member functions.)

Gnome::Gda::Command wrap (GdaCommand* object, bool take_copy=false)
 A Glib::wrap() method for this object.


Detailed Description

For issuing commands to the provider.

The Command object holds data needed to issue a command to the providers. Applications usually create a Command, set its properties (via the set_* methods) and pass it over to the database using the Connection methods.

Commands is that they can be reused. That is, applications don't need to create a command object every time they want to run a command on the connected database. Moreover, the ability to create command strings with placeholders allows the use of parameters to specify the values for those placeholders. Thus, an application can create a command of the form:

INSERT INTO employees VALUES (id, name, address, salary)

and reuse the same command over and over, just using different values for the placeholders.

The value for the placeholders is specified when sending the Command to a database connection, which is done via the Gda::Connection::execute function.


Constructor & Destructor Documentation

Gnome::Gda::Command::Command (  ) 

Gnome::Gda::Command::Command ( GdaCommand *  castitem,
bool  make_a_copy = false 
) [explicit]

Gnome::Gda::Command::Command ( const Command src  ) 

Gnome::Gda::Command::~Command (  ) 

Gnome::Gda::Command::Command ( const Glib::ustring text,
CommandType  type = COMMAND_TYPE_SQL,
CommandOptions  options = COMMAND_OPTION_STOP_ON_ERRORS 
) [explicit]

Creates a new Command.

If there are conflicting options, this will set options to GDA_COMMAND_OPTION_DEFAULT.

Parameters:
text The text of the command.
type The type of the command.
options Additional command options.


Member Function Documentation

CommandType Gnome::Gda::Command::get_command_type (  )  const

Gets the command type of cmd .

Returns:
The command type of cmd .

CommandOptions Gnome::Gda::Command::get_options (  )  const

Gets the command options of cmd .

Returns:
The command options of cmd .

Glib::ustring Gnome::Gda::Command::get_text (  )  const

Gets the command text held by cmd .

Returns:
The command string of cmd .

const GdaCommand* Gnome::Gda::Command::gobj (  )  const [inline]

GdaCommand* Gnome::Gda::Command::gobj (  )  [inline]

GdaCommand* Gnome::Gda::Command::gobj_copy (  )  const

Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs.

Command& Gnome::Gda::Command::operator= ( const Command src  ) 

void Gnome::Gda::Command::set_command_type ( CommandType  type  ) 

Sets the command type of cmd .

Parameters:
type The command type.

void Gnome::Gda::Command::set_options ( CommandOptions  options  ) 

Sets the command options of cmd .

If there conflicting options, it will just leave the value as before.

Parameters:
options The command options.

void Gnome::Gda::Command::set_text ( const Glib::ustring text  ) 

Sets the command text of cmd .

Parameters:
text The command text.


Friends And Related Function Documentation

Gnome::Gda::Command wrap ( GdaCommand *  object,
bool  take_copy = false 
) [related]

A Glib::wrap() method for this object.

Parameters:
object The C instance.
take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns:
A C++ instance that wraps this C instance.


Member Data Documentation

GdaCommand* Gnome::Gda::Command::gobject_ [protected]


The documentation for this class was generated from the following file:
Generated for libgdamm by Doxygen 1.5.1 © 1997-2001