GDA First Steps
GDA is a middleware to access data stored in a database. To access this data you must have the following:
A GdaServerProvider, a database provider which implements the GDA interfaces to access its data.
- Configure a Data Source Name, with the data necesary to allow GDA to connect to the Server Provider; see [ConfigureDSN: Configure a Data Source Name].
GDA will allows you to create powerful queries over database's tables, insert new data and modify them; all of this, using the Object Oriented system in GObject.
Even you can create powerful applications using the all the API's functions, for the momment, as an introduction and a quick start using GDA,
- Open a connection to a DSN
- Create a Table
- Drop a Table
- Insert a Row in a Table
- Delete a Row from a Table
- Update a Row in a Table
- Execute a SELECT command
- Execute a SQL command
Most of this functions is to easy use of GDA's API simplify the way you'll perform this common task.
Open a connection to a DSN
If you have a DSN configured in your system, you can use gda_open_connection to get a new GdaConnection, which is used in all the convenient functions to perform its tasks.
gda_open_connection (const gchar *dsn, const gchar *username, const gchar *password, GdaConnectionOptions options, GError **error)
dsn: The Data Source Name configured in your system.
username: The user's name to connect to the DSN.
password: The user's password to connect to the DSN.
options: The connection options as a GdaConnectionOptions, where you can set if you'll do a readonly or read/write.
error: If there is an internal error in the connection, this funtion will set this pointer, with the corresponding error's message.
Create a Table