gda-connection

Name

gda-connection — one line description goes here.

Synopsis



Gda_Connection* gda_connection_new          (CORBA_ORB orb);
void        gda_connection_free             (Gda_Connection *cnc);
GList*      gda_connection_list_providers   (void);
void        gda_connection_set_provider     (Gda_Connection *cnc,
                                             gchar *name);
const gchar* gda_connection_get_provider    (Gda_Connection *cnc);
void        gda_connection_set_default_db   (Gda_Connection *cnc,
                                             gchar *dsn);
gint        gda_connection_open             (Gda_Connection *cnc,
                                             gchar *dsn,
                                             gchar *user,
                                             gchar *pwd);
gint        gda_connection_close            (Gda_Connection *cnc);
Gda_Recordset* gda_connection_open_schema   (Gda_Connection *cnc,
                                             GDA_Connection_QType t,
                                             ...);
GList*      gda_connection_get_errors       (Gda_Connection *cnc);
GList*      gda_connection_list_datasources (Gda_Connection *cnc);
#define     gda_connection_get_dsn          (cnc)
#define     gda_connection_get_user         (cnc)

Description

Details


gda_connection_new()

Gda_Connection* gda_connection_new          (CORBA_ORB orb);

Allocates space for a client side connection object

orb : The ORB
Returns : the pointer to the allocated object


gda_connection_free()

void        gda_connection_free             (Gda_Connection *cnc);

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.

cnc : the connection


gda_connection_list_providers()

GList*      gda_connection_list_providers   (void);

Returns : 


gda_connection_set_provider()

void        gda_connection_set_provider     (Gda_Connection *cnc,
                                             gchar *name);

Registers name as the provider for this connection. This should be the GOAD id of the CORBA server to use

cnc : connection object
name : name of the provider


gda_connection_get_provider()

const gchar* gda_connection_get_provider    (Gda_Connection *cnc);

Retuns the provider used for this connection

cnc : Connection object
Returns : a reference to the provider name


gda_connection_set_default_db()

void        gda_connection_set_default_db   (Gda_Connection *cnc,
                                             gchar *dsn);

Registers the DSN as the name of the default DB to access when the connection is opened

cnc : the connection object
dsn : the DSN of the default database


gda_connection_open()

gint        gda_connection_open             (Gda_Connection *cnc,
                                             gchar *dsn,
                                             gchar *user,
                                             gchar *pwd);

The function activates the correct CORBA server (defined with he #gda_connection_set_provider() function. Then it tries to open the database using the DSN or the default database as a data source. If user or pwd is not NULL, it will overwrite the appropriate entry in the DSN passed as par2. Entries in the DSN have the form <key> = <value> seperated from the database name . Currently the DSN is not parsed.

cnc : the connection object which describes the server and the database name to which the connection shuld be opened
dsn : The DSN of the database. Can be NULL.
user : The username for authentication to the database. Can be NULL.
pwd : The password for authentication to the database. Can be NULL.
Returns : 0 on success, -1 on error


gda_connection_close()

gint        gda_connection_close            (Gda_Connection *cnc);

Closes the connection object and all associated Gda_Recordset objects. Gda_Command objects are not closed, but can't be used anymore. Transactions pending on this objects are aborted and an error is returned.

cnc : The connection object which should be closed
Returns : 0 on success, -1 on error


gda_connection_open_schema()

Gda_Recordset* gda_connection_open_schema   (Gda_Connection *cnc,
                                             GDA_Connection_QType t,
                                             ...);

Retrieves meta data about the data source to which the connection object is connected. The constraints is a list of enum/string pairs. The end of the list must be marked by the special value GDA_Connection_no_CONSTRAINT

cnc : Connection object
t : Query type
... : Constraint values
Returns : The recordset which holds the results.


gda_connection_get_errors()

GList*      gda_connection_get_errors       (Gda_Connection *cnc);

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.

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.

cnc : the connection object
Returns : a Glist holding the error objects.


gda_connection_list_datasources()

GList*      gda_connection_list_datasources (Gda_Connection *cnc);

List all datasources which can be used with this connection object.

cnc : the connection object:
Returns : a GList with the DSNs of all known data sources.


gda_connection_get_dsn()

#define                     gda_connection_get_dsn(cnc)      ((cnc) ? cnc->database : 0)

cnc : 


gda_connection_get_user()

#define                    gda_connection_get_user(cnc)     ((cnc) ? cnc->user : 0)

cnc :