| GNOME Data Access 4.0 manual |
|---|
- Open a connection
- Define a data source (DSN)
- Execute a SELECT command
- Modify the result of a SELECT command
- Execute an INSERT, UPDATE or DELETE command
- Get the last inserted row
- Execute a DDL command
- Get information about a table's columns
- Update the meta data about a table
- Validate a DML statement
- Control value's assignment to various objects
- Add your own data to a GdaMetaStore
This section is a list of small HOWTOs to get started quickly for some specific tasks, without the need to read all the documentation: quickly get to the code and read the corresponding documentation for further details.
Opening a connection to a database creates a GdaConnection object which is required to execute commands. The connections' parameters (which are specific to each type of database) can be either specified when opening the connection, or be used to define a data source (DSN) and the DSN name is then specified to open the connection.
For example, opening a connection to a PostgreSQL database named "mydb" one could use the following code:
GdaConnection *connection;
connection = gda_connection_open_from_string ("PostgreSQL", "DB_NAME=mydb",
"USERNAME=martin;PASSWORD=luther",
GDA_CONNECTION_OPTIONS_READ_ONLY, NULL);
if (!connection)
g_print ("CONNECTION FAILED\n");
else {
/* use the opened connection */
/* close the connection (assuming it's not used by another object) */
g_object_unref (connection);
}
