<refentry id="GdaConnection">
<refmeta>
<refentrytitle>GdaConnection</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>LIBGDA-CLIENT Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GdaConnection</refname><refpurpose>Connection management</refpurpose>
</refnamediv>

<refsynopsisdiv><title>Synopsis</title>
<synopsis>



<link linkend="GdaConnection">GdaConnection</link>* <link linkend="gda-connection-new">gda_connection_new</link>           (<link linkend="CORBA-ORB-CAPS">CORBA_ORB</link> orb);
<link linkend="GdaConnection">GdaConnection</link>* <link linkend="gda-connection-new-from-dsn">gda_connection_new_from_dsn</link>  (const <link linkend="gchar">gchar</link> *dsn_name,
                                             const <link linkend="gchar">gchar</link> *username,
                                             const <link linkend="gchar">gchar</link> *password);
void        <link linkend="gda-connection-free">gda_connection_free</link>             (<link linkend="GdaConnection">GdaConnection</link> *cnc);
void        <link linkend="gda-connection-set-provider">gda_connection_set_provider</link>     (<link linkend="GdaConnection">GdaConnection</link> *cnc,
                                             <link linkend="gchar">gchar</link> *name);
const <link linkend="gchar">gchar</link>* <link linkend="gda-connection-get-provider">gda_connection_get_provider</link>    (<link linkend="GdaConnection">GdaConnection</link> *cnc);
<link linkend="gboolean">gboolean</link>    <link linkend="gda-connection-supports">gda_connection_supports</link>         (<link linkend="GdaConnection">GdaConnection</link> *cnc,
                                             <link linkend="GDA-Connection-Feature">GDA_Connection_Feature</link> feature);
void        <link linkend="gda-connection-set-default-db">gda_connection_set_default_db</link>   (<link linkend="GdaConnection">GdaConnection</link> *cnc,
                                             <link linkend="gchar">gchar</link> *dsn);
<link linkend="gint">gint</link>        <link linkend="gda-connection-open">gda_connection_open</link>             (<link linkend="GdaConnection">GdaConnection</link> *cnc,
                                             const <link linkend="gchar">gchar</link> *dsn,
                                             const <link linkend="gchar">gchar</link> *user,
                                             const <link linkend="gchar">gchar</link> *pwd);
void        <link linkend="gda-connection-close">gda_connection_close</link>            (<link linkend="GdaConnection">GdaConnection</link> *cnc);
<link linkend="GdaRecordset">GdaRecordset</link>* <link linkend="gda-connection-open-schema">gda_connection_open_schema</link>    (<link linkend="GdaConnection">GdaConnection</link> *cnc,
                                             <link linkend="GDA-Connection-QType">GDA_Connection_QType</link> t,
                                             ...);
<link linkend="GdaRecordset">GdaRecordset</link>* <link linkend="gda-connection-open-schema-array">gda_connection_open_schema_array</link>
                                            (<link linkend="GdaConnection">GdaConnection</link> *cnc,
                                             <link linkend="GDA-Connection-QType">GDA_Connection_QType</link> t,
                                             <link linkend="GdaConstraint-Element">GdaConstraint_Element</link>*);
<link linkend="glong">glong</link>       <link linkend="gda-connection-modify-schema">gda_connection_modify_schema</link>    (<link linkend="GdaConnection">GdaConnection</link> *cnc,
                                             <link linkend="GDA-Connection-QType">GDA_Connection_QType</link> t,
                                             ...);
<link linkend="GList">GList</link>*      <link linkend="gda-connection-get-errors">gda_connection_get_errors</link>       (<link linkend="GdaConnection">GdaConnection</link> *cnc);
<link linkend="gint">gint</link>        <link linkend="gda-connection-begin-transaction">gda_connection_begin_transaction</link>
                                            (<link linkend="GdaConnection">GdaConnection</link> *cnc);
<link linkend="gint">gint</link>        <link linkend="gda-connection-commit-transaction">gda_connection_commit_transaction</link>
                                            (<link linkend="GdaConnection">GdaConnection</link> *cnc);
<link linkend="gint">gint</link>        <link linkend="gda-connection-rollback-transaction">gda_connection_rollback_transaction</link>
                                            (<link linkend="GdaConnection">GdaConnection</link> *cnc);
<link linkend="GdaRecordset">GdaRecordset</link>* <link linkend="gda-connection-execute">gda_connection_execute</link>        (<link linkend="GdaConnection">GdaConnection</link> *cnc,
                                             <link linkend="gchar">gchar</link> *txt,
                                             <link linkend="gulong">gulong</link> *reccount,
                                             <link linkend="gulong">gulong</link> flags);
<link linkend="gint">gint</link>        <link linkend="gda-connection-start-logging">gda_connection_start_logging</link>    (<link linkend="GdaConnection">GdaConnection</link> *cnc,
                                             <link linkend="gchar">gchar</link> *filename);
<link linkend="gint">gint</link>        <link linkend="gda-connection-stop-logging">gda_connection_stop_logging</link>     (<link linkend="GdaConnection">GdaConnection</link> *cnc);
<link linkend="gchar">gchar</link>*      <link linkend="gda-connection-create-recordset">gda_connection_create_recordset</link> (<link linkend="GdaConnection">GdaConnection</link> *cnc,
                                             <link linkend="GdaRecordset">GdaRecordset</link> *rs);
<link linkend="gint">gint</link>        <link linkend="gda-connection-corba-exception">gda_connection_corba_exception</link>  (<link linkend="GdaConnection">GdaConnection</link> *cnc,
                                             <link linkend="CORBA-Environment">CORBA_Environment</link> *ev);
void        <link linkend="gda-connection-add-single-error">gda_connection_add_single_error</link> (<link linkend="GdaConnection">GdaConnection</link> *cnc,
                                             <link linkend="GdaError">GdaError</link> *error);
void        <link linkend="gda-connection-add-error-list">gda_connection_add_error_list</link>   (<link linkend="GdaConnection">GdaConnection</link> *cnc,
                                             <link linkend="GList">GList</link> *list);
#define     <link linkend="gda-connection-is-open">gda_connection_is_open</link>          (cnc)
#define     <link linkend="gda-connection-get-dsn">gda_connection_get_dsn</link>          (cnc)
#define     <link linkend="gda-connection-get-user">gda_connection_get_user</link>         (cnc)
#define     <link linkend="gda-connection-get-password">gda_connection_get_password</link>     (cnc)
<link linkend="gchar">gchar</link>*      <link linkend="gda-connection-get-version">gda_connection_get_version</link>      (<link linkend="GdaConnection">GdaConnection</link> *cnc);
<link linkend="gchar">gchar</link>*      <link linkend="gda-connection-sql2xml">gda_connection_sql2xml</link>          (<link linkend="GdaConnection">GdaConnection</link> *cnc,
                                             const <link linkend="gchar">gchar</link> *sql);
<link linkend="gchar">gchar</link>*      <link linkend="gda-connection-xml2sql">gda_connection_xml2sql</link>          (<link linkend="GdaConnection">GdaConnection</link> *cnc,
                                             const <link linkend="gchar">gchar</link> *xml);
void        <link linkend="gda-connection-add-listener">gda_connection_add_listener</link>     (<link linkend="GdaConnection">GdaConnection</link> *cnc,
                                             <link linkend="GdaListener">GdaListener</link> *listener);
void        <link linkend="gda-connection-remove-listener">gda_connection_remove_listener</link>  (<link linkend="GdaConnection">GdaConnection</link> *cnc,
                                             <link linkend="GdaListener">GdaListener</link> *listener);

</synopsis>
</refsynopsisdiv>

<refsect1>
<title>Object Hierarchy</title>
<synopsis>

  <link linkend="GtkObject">GtkObject</link>
   +----GdaConnection
</synopsis>

</refsect1>


<refsect1>
<title>Signal Prototypes</title>
<synopsis>

&quot;<link linkend="GdaConnection-error">error</link>&quot;     void        user_function      (<link linkend="GdaConnection">GdaConnection</link> *gdaconnection,
                                            <link linkend="gpointer">gpointer</link> arg1,
                                            <link linkend="gpointer">gpointer</link> user_data);
&quot;<link linkend="GdaConnection-warning">warning</link>&quot;   void        user_function      (<link linkend="GdaConnection">GdaConnection</link> *gdaconnection,
                                            <link linkend="gpointer">gpointer</link> arg1,
                                            <link linkend="gpointer">gpointer</link> user_data);
&quot;<link linkend="GdaConnection-open">open</link>&quot;      void        user_function      (<link linkend="GdaConnection">GdaConnection</link> *gdaconnection,
                                            <link linkend="gpointer">gpointer</link> user_data);
&quot;<link linkend="GdaConnection-close">close</link>&quot;     void        user_function      (<link linkend="GdaConnection">GdaConnection</link> *gdaconnection,
                                            <link linkend="gpointer">gpointer</link> user_data);
</synopsis>
</refsect1>


<refsect1>
<title>Description</title>
<para>

</para>
</refsect1>

<refsect1>
<title>Details</title>
<refsect2>
<title><anchor id="gda-connection-new">gda_connection_new ()</title>
<programlisting><link linkend="GdaConnection">GdaConnection</link>* gda_connection_new           (<link linkend="CORBA-ORB-CAPS">CORBA_ORB</link> orb);</programlisting>
<para>
Allocates space for a client side connection object</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>orb</parameter>&nbsp;:</entry>
<entry> the ORB
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> the pointer to the allocated object
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gda-connection-new-from-dsn">gda_connection_new_from_dsn ()</title>
<programlisting><link linkend="GdaConnection">GdaConnection</link>* gda_connection_new_from_dsn  (const <link linkend="gchar">gchar</link> *dsn_name,
                                             const <link linkend="gchar">gchar</link> *username,
                                             const <link linkend="gchar">gchar</link> *password);</programlisting>
<para>
Creates a <link linkend="GdaConnection">GdaConnection</link> object from the configuration stored for the
given data source.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>dsn_name</parameter>&nbsp;:</entry>
<entry> Data source name
</entry></row>
<row><entry align="right"><parameter>username</parameter>&nbsp;:</entry>
<entry> User name
</entry></row>
<row><entry align="right"><parameter>password</parameter>&nbsp;:</entry>
<entry> Password
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> an <link linkend="GdaConnection">GdaConnection</link> object already connected to the underlying
database.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gda-connection-free">gda_connection_free ()</title>
<programlisting>void        gda_connection_free             (<link linkend="GdaConnection">GdaConnection</link> *cnc);</programlisting>
<para>
If the connection is open the connection is closed and all
associated objects (commands, recordsets, errors) are deleted. The
memory is freed. The connection object cannot be used any more.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>cnc</parameter>&nbsp;:</entry>
<entry> the connection
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gda-connection-set-provider">gda_connection_set_provider ()</title>
<programlisting>void        gda_connection_set_provider     (<link linkend="GdaConnection">GdaConnection</link> *cnc,
                                             <link linkend="gchar">gchar</link> *name);</programlisting>
<para>
Registers <parameter>name</parameter> as the provider for this connection. This
should be the id of the CORBA server to
use</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>cnc</parameter>&nbsp;:</entry>
<entry> connection object
</entry></row>
<row><entry align="right"><parameter>name</parameter>&nbsp;:</entry>
<entry> name of the provider
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gda-connection-get-provider">gda_connection_get_provider ()</title>
<programlisting>const <link linkend="gchar">gchar</link>* gda_connection_get_provider    (<link linkend="GdaConnection">GdaConnection</link> *cnc);</programlisting>
<para>
Retuns the provider used for this connection</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>cnc</parameter>&nbsp;:</entry>
<entry> Connection object
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> a reference to the provider name
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gda-connection-supports">gda_connection_supports ()</title>
<programlisting><link linkend="gboolean">gboolean</link>    gda_connection_supports         (<link linkend="GdaConnection">GdaConnection</link> *cnc,
                                             <link linkend="GDA-Connection-Feature">GDA_Connection_Feature</link> feature);</programlisting>
<para>
Return information on features supported by the underlying database
system.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>cnc</parameter>&nbsp;:</entry>
<entry> the connection object
</entry></row>
<row><entry align="right"><parameter>feature</parameter>&nbsp;:</entry>
<entry> feature to be tested
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> whether the requested feature is supported or not
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gda-connection-set-default-db">gda_connection_set_default_db ()</title>
<programlisting>void        gda_connection_set_default_db   (<link linkend="GdaConnection">GdaConnection</link> *cnc,
                                             <link linkend="gchar">gchar</link> *dsn);</programlisting>
<para>
Registers the DSN as the name of the default DB to access when the
connection is opened</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>cnc</parameter>&nbsp;:</entry>
<entry> the connection object
</entry></row>
<row><entry align="right"><parameter>dsn</parameter>&nbsp;:</entry>
<entry> the DSN of the default database
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gda-connection-open">gda_connection_open ()</title>
<programlisting><link linkend="gint">gint</link>        gda_connection_open             (<link linkend="GdaConnection">GdaConnection</link> *cnc,
                                             const <link linkend="gchar">gchar</link> *dsn,
                                             const <link linkend="gchar">gchar</link> *user,
                                             const <link linkend="gchar">gchar</link> *pwd);</programlisting>
<para>
The function activates the correct CORBA server (defined with the
#<link linkend="gda-connection-set-provider">gda_connection_set_provider</link>() function. Then it
tries to open the database using the DSN or the default database
as a data source. If <parameter>user</parameter> or <parameter>pwd</parameter> is not NULL, it will overwrite the
appropriate entry in the DSN passed as <parameter>par2</parameter>. Entries in the DSN have the form
&lt;key&gt; = &lt;value&gt; seperated from the database name . Currently the DSN is not
parsed.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>cnc</parameter>&nbsp;:</entry>
<entry> the connection object which describes the server and
       the database name to which the connection shuld be opened
</entry></row>
<row><entry align="right"><parameter>dsn</parameter>&nbsp;:</entry>
<entry> The DSN of the database. Can be NULL.
</entry></row>
<row><entry align="right"><parameter>user</parameter>&nbsp;:</entry>
<entry> The username for authentication to the database. Can be NULL.
</entry></row>
<row><entry align="right"><parameter>pwd</parameter>&nbsp;:</entry>
<entry> The password for authentication to the database. Can be NULL.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> 0 on success, -1 on error
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gda-connection-close">gda_connection_close ()</title>
<programlisting>void        gda_connection_close            (<link linkend="GdaConnection">GdaConnection</link> *cnc);</programlisting>
<para>
Closes the connection object and all associated <link linkend="GdaRecordset">GdaRecordset</link> objects.
<link linkend="GdaCommand">GdaCommand</link> objects are not closed, but can't be used anymore. Transactions
pending on this objects are aborted and an error is returned.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>cnc</parameter>&nbsp;:</entry>
<entry> The connection object which should be closed
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gda-connection-open-schema">gda_connection_open_schema ()</title>
<programlisting><link linkend="GdaRecordset">GdaRecordset</link>* gda_connection_open_schema    (<link linkend="GdaConnection">GdaConnection</link> *cnc,
                                             <link linkend="GDA-Connection-QType">GDA_Connection_QType</link> t,
                                             ...);</programlisting>
<para>
Retrieves meta data about the data source to which the
connection object is connected.
The <parameter>constraints</parameter> is a list of enum/string pairs.
The end of the list must be marked by the special value
GDA_Connection_no_CONSTRAINT</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>cnc</parameter>&nbsp;:</entry>
<entry> Connection object
</entry></row>
<row><entry align="right"><parameter>t</parameter>&nbsp;:</entry>
<entry> Query type
</entry></row>
<row><entry align="right"><parameter>...</parameter>&nbsp;:</entry>
<entry> Constraint values 
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> The recordset which holds the results.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gda-connection-open-schema-array">gda_connection_open_schema_array ()</title>
<programlisting><link linkend="GdaRecordset">GdaRecordset</link>* gda_connection_open_schema_array
                                            (<link linkend="GdaConnection">GdaConnection</link> *cnc,
                                             <link linkend="GDA-Connection-QType">GDA_Connection_QType</link> t,
                                             <link linkend="GdaConstraint-Element">GdaConstraint_Element</link>*);</programlisting>
<para>
Retrieves meta data about the data source to which the
connection object is connected.
The <parameter>elems</parameter> is an array of Constraint_Element item. The last item
must have it's type element set to GDA_Connection_no_CONSTRAINT
If <parameter>elems</parameter> is NULL, no constraints are used.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>cnc</parameter>&nbsp;:</entry>
<entry> Connection object
</entry></row>
<row><entry align="right"><parameter>t</parameter>&nbsp;:</entry>
<entry> Query type
</entry></row>
<row><entry align="right"><parameter>Param3</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> The recordset which holds the results.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gda-connection-modify-schema">gda_connection_modify_schema ()</title>
<programlisting><link linkend="glong">glong</link>       gda_connection_modify_schema    (<link linkend="GdaConnection">GdaConnection</link> *cnc,
                                             <link linkend="GDA-Connection-QType">GDA_Connection_QType</link> t,
                                             ...);</programlisting>
<para>
</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>cnc</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>t</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>...</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gda-connection-get-errors">gda_connection_get_errors ()</title>
<programlisting><link linkend="GList">GList</link>*      gda_connection_get_errors       (<link linkend="GdaConnection">GdaConnection</link> *cnc);</programlisting>
<para>
Returns a list of all errors for this connection object. This
function also clears the error list. The errors are stored in LIFO
order, so the last error which happend is stored as the first
element in the list. Advancing the list means to get back in time and 
retrieve earlier errors.
</para>
<para>
The farther away from the client the error happens, the later it
is in the queue. If an error happens on the client and then in the
CORBA layer and then on the server, you will get the server error
first.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>cnc</parameter>&nbsp;:</entry>
<entry> the connection object
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> a <link linkend="Glist">Glist</link> holding the error objects.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gda-connection-begin-transaction">gda_connection_begin_transaction ()</title>
<programlisting><link linkend="gint">gint</link>        gda_connection_begin_transaction
                                            (<link linkend="GdaConnection">GdaConnection</link> *cnc);</programlisting>
<para>
Start a new transaction on <parameter>cnc</parameter></para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>cnc</parameter>&nbsp;:</entry>
<entry> the connection object
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> 0 if everything is okay, -1 on error
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gda-connection-commit-transaction">gda_connection_commit_transaction ()</title>
<programlisting><link linkend="gint">gint</link>        gda_connection_commit_transaction
                                            (<link linkend="GdaConnection">GdaConnection</link> *cnc);</programlisting>
<para>
Commit a pending transaction on <parameter>cnc</parameter></para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>cnc</parameter>&nbsp;:</entry>
<entry> the connection object
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> 0 if everything is okay, -1 on error
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gda-connection-rollback-transaction">gda_connection_rollback_transaction ()</title>
<programlisting><link linkend="gint">gint</link>        gda_connection_rollback_transaction
                                            (<link linkend="GdaConnection">GdaConnection</link> *cnc);</programlisting>
<para>
Abort and rollback a pending transaction on <parameter>cnc</parameter></para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>cnc</parameter>&nbsp;:</entry>
<entry> the connection object
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> 0 if everything is okay, -1 on error
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gda-connection-execute">gda_connection_execute ()</title>
<programlisting><link linkend="GdaRecordset">GdaRecordset</link>* gda_connection_execute        (<link linkend="GdaConnection">GdaConnection</link> *cnc,
                                             <link linkend="gchar">gchar</link> *txt,
                                             <link linkend="gulong">gulong</link> *reccount,
                                             <link linkend="gulong">gulong</link> flags);</programlisting>
<para>
Executes <parameter>txt</parameter>. An internal GdaCommand object is used for
execution. This command object is destroyed automatically after the 
commadn has finished.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>cnc</parameter>&nbsp;:</entry>
<entry> the connection
</entry></row>
<row><entry align="right"><parameter>txt</parameter>&nbsp;:</entry>
<entry> the statement to execute
</entry></row>
<row><entry align="right"><parameter>reccount</parameter>&nbsp;:</entry>
<entry> a pointer to a gulong. The number of affected records is 
stored in the space where the pointer points to
</entry></row>
<row><entry align="right"><parameter>flags</parameter>&nbsp;:</entry>
<entry> falgs (currently unused
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> a recordset on success or NULL on error.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gda-connection-start-logging">gda_connection_start_logging ()</title>
<programlisting><link linkend="gint">gint</link>        gda_connection_start_logging    (<link linkend="GdaConnection">GdaConnection</link> *cnc,
                                             <link linkend="gchar">gchar</link> *filename);</programlisting>
<para>
This function causes the server to log the statements
it executes in <parameter>filename</parameter>.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>cnc</parameter>&nbsp;:</entry>
<entry> the connection
</entry></row>
<row><entry align="right"><parameter>filename</parameter>&nbsp;:</entry>
<entry> the name of the logfile
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> -1 on error and 0 if everything is okay
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gda-connection-stop-logging">gda_connection_stop_logging ()</title>
<programlisting><link linkend="gint">gint</link>        gda_connection_stop_logging     (<link linkend="GdaConnection">GdaConnection</link> *cnc);</programlisting>
<para>
This function stops the database server logs</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>cnc</parameter>&nbsp;:</entry>
<entry> the connection
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> -1 on error and 0 if everything is okay
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gda-connection-create-recordset">gda_connection_create_recordset ()</title>
<programlisting><link linkend="gchar">gchar</link>*      gda_connection_create_recordset (<link linkend="GdaConnection">GdaConnection</link> *cnc,
                                             <link linkend="GdaRecordset">GdaRecordset</link> *rs);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>cnc</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>rs</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gda-connection-corba-exception">gda_connection_corba_exception ()</title>
<programlisting><link linkend="gint">gint</link>        gda_connection_corba_exception  (<link linkend="GdaConnection">GdaConnection</link> *cnc,
                                             <link linkend="CORBA-Environment">CORBA_Environment</link> *ev);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>cnc</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>ev</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gda-connection-add-single-error">gda_connection_add_single_error ()</title>
<programlisting>void        gda_connection_add_single_error (<link linkend="GdaConnection">GdaConnection</link> *cnc,
                                             <link linkend="GdaError">GdaError</link> *error);</programlisting>
<para>
</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>cnc</parameter>&nbsp;:</entry>
<entry> a connection
</entry></row>
<row><entry align="right"><parameter>error</parameter>&nbsp;:</entry>
<entry> error object
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gda-connection-add-error-list">gda_connection_add_error_list ()</title>
<programlisting>void        gda_connection_add_error_list   (<link linkend="GdaConnection">GdaConnection</link> *cnc,
                                             <link linkend="GList">GList</link> *list);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>cnc</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>list</parameter>&nbsp;:</entry>
<entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gda-connection-is-open">gda_connection_is_open()</title>
<programlisting>#define            gda_connection_is_open(cnc)        ((cnc) ? GDA_CONNECTION(cnc)-&gt;is_open : FALSE)
</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>cnc</parameter>&nbsp;:</entry>
<entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gda-connection-get-dsn">gda_connection_get_dsn()</title>
<programlisting>#define            gda_connection_get_dsn(cnc)        ((cnc) ? GDA_CONNECTION(cnc)-&gt;database : 0)
</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>cnc</parameter>&nbsp;:</entry>
<entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gda-connection-get-user">gda_connection_get_user()</title>
<programlisting>#define            gda_connection_get_user(cnc)       ((cnc) ? GDA_CONNECTION(cnc)-&gt;user : 0)
</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>cnc</parameter>&nbsp;:</entry>
<entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gda-connection-get-password">gda_connection_get_password()</title>
<programlisting>#define            gda_connection_get_password(cnc)   ((cnc) ? GDA_CONNECTION(cnc)-&gt;passwd : 0)
</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>cnc</parameter>&nbsp;:</entry>
<entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gda-connection-get-version">gda_connection_get_version ()</title>
<programlisting><link linkend="gchar">gchar</link>*      gda_connection_get_version      (<link linkend="GdaConnection">GdaConnection</link> *cnc);</programlisting>
<para>
Get the version number of the underlying provider</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>cnc</parameter>&nbsp;:</entry>
<entry> connection
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gda-connection-sql2xml">gda_connection_sql2xml ()</title>
<programlisting><link linkend="gchar">gchar</link>*      gda_connection_sql2xml          (<link linkend="GdaConnection">GdaConnection</link> *cnc,
                                             const <link linkend="gchar">gchar</link> *sql);</programlisting>
<para>
Converts the given SQL command to a <link linkend="GdaXmlQuery">GdaXmlQuery</link></para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>cnc</parameter>&nbsp;:</entry>
<entry> connection
</entry></row>
<row><entry align="right"><parameter>sql</parameter>&nbsp;:</entry>
<entry> SQL string
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gda-connection-xml2sql">gda_connection_xml2sql ()</title>
<programlisting><link linkend="gchar">gchar</link>*      gda_connection_xml2sql          (<link linkend="GdaConnection">GdaConnection</link> *cnc,
                                             const <link linkend="gchar">gchar</link> *xml);</programlisting>
<para>
Converts the given <link linkend="GdaXmlQuery">GdaXmlQuery</link> to a SQL string for the underlying provider</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>cnc</parameter>&nbsp;:</entry>
<entry> connection
</entry></row>
<row><entry align="right"><parameter>xml</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gda-connection-add-listener">gda_connection_add_listener ()</title>
<programlisting>void        gda_connection_add_listener     (<link linkend="GdaConnection">GdaConnection</link> *cnc,
                                             <link linkend="GdaListener">GdaListener</link> *listener);</programlisting>
<para>
</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>cnc</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>listener</parameter>&nbsp;:</entry>
<entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gda-connection-remove-listener">gda_connection_remove_listener ()</title>
<programlisting>void        gda_connection_remove_listener  (<link linkend="GdaConnection">GdaConnection</link> *cnc,
                                             <link linkend="GdaListener">GdaListener</link> *listener);</programlisting>
<para>
</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>cnc</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>listener</parameter>&nbsp;:</entry>
<entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>

</refsect1>

<refsect1>
<title>Signals</title>
<refsect2><title><anchor id="GdaConnection-error">The &quot;error&quot; signal</title>
<programlisting>void        user_function                  (<link linkend="GdaConnection">GdaConnection</link> *gdaconnection,
                                            <link linkend="gpointer">gpointer</link> arg1,
                                            <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gdaconnection</parameter>&nbsp;:</entry>
<entry>the object which received the signal.
</entry></row>
<row><entry align="right"><parameter>arg1</parameter>&nbsp;:</entry>
<entry>

</entry></row>
<row><entry align="right"><parameter>user_data</parameter>&nbsp;:</entry>
<entry>user data set when the signal handler was connected.</entry></row>
</tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="GdaConnection-warning">The &quot;warning&quot; signal</title>
<programlisting>void        user_function                  (<link linkend="GdaConnection">GdaConnection</link> *gdaconnection,
                                            <link linkend="gpointer">gpointer</link> arg1,
                                            <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gdaconnection</parameter>&nbsp;:</entry>
<entry>the object which received the signal.
</entry></row>
<row><entry align="right"><parameter>arg1</parameter>&nbsp;:</entry>
<entry>

</entry></row>
<row><entry align="right"><parameter>user_data</parameter>&nbsp;:</entry>
<entry>user data set when the signal handler was connected.</entry></row>
</tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="GdaConnection-open">The &quot;open&quot; signal</title>
<programlisting>void        user_function                  (<link linkend="GdaConnection">GdaConnection</link> *gdaconnection,
                                            <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gdaconnection</parameter>&nbsp;:</entry>
<entry>the object which received the signal.

</entry></row>
<row><entry align="right"><parameter>user_data</parameter>&nbsp;:</entry>
<entry>user data set when the signal handler was connected.</entry></row>
</tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="GdaConnection-close">The &quot;close&quot; signal</title>
<programlisting>void        user_function                  (<link linkend="GdaConnection">GdaConnection</link> *gdaconnection,
                                            <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gdaconnection</parameter>&nbsp;:</entry>
<entry>the object which received the signal.

</entry></row>
<row><entry align="right"><parameter>user_data</parameter>&nbsp;:</entry>
<entry>user data set when the signal handler was connected.</entry></row>
</tbody></tgroup></informaltable></refsect2>
</refsect1>



</refentry>
