# GdaXmlConnection

## Name

GdaXmlConnection --

## Synopsis

    struct      GdaXmlConnectionPrivate;
    GdaXmlConnection* gda_xml_connection_new    (void);
    GdaXmlConnection* gda_xml_connection_new_from_file
                                                (const gchar *filename);
    GdaXmlConnection* gda_xml_connection_new_from_string
                                                (const gchar *string);
    gboolean    gda_xml_connection_set_from_file
                                                (GdaXmlConnection *xmlcnc,
                                                 const gchar *filename);
    gboolean    gda_xml_connection_set_from_string
                                                (GdaXmlConnection *xmlcnc,
                                                 const gchar *string);
    const gchar* gda_xml_connection_get_dsn     (GdaXmlConnection *xmlcnc);
    void        gda_xml_connection_set_dsn      (GdaXmlConnection *xmlcnc,
                                                 const gchar *dsn);
    const gchar* gda_xml_connection_get_username
                                                (GdaXmlConnection *xmlcnc);
    void        gda_xml_connection_set_username (GdaXmlConnection *xmlcnc,
                                                 const gchar *username);
    const gchar* gda_xml_connection_get_password
                                                (GdaXmlConnection *xmlcnc);
    void        gda_xml_connection_set_password (GdaXmlConnection *xmlcnc,
                                                 const gchar *password);

## Description

## Details

### struct GdaXmlConnectionPrivate

    struct GdaXmlConnectionPrivate;

### gda_xml_connection_new ()

    GdaXmlConnection* gda_xml_connection_new    (void);

Create a new GdaXmlConnection object, which lets you parse and/or create .connection files, which are XML files used to specify all parameters needed to open a database connection, and which can be used to store user's connection preferences, or for automatic connection to databases from unattended scripts and such.

Returns : | the newly created object.

### gda_xml_connection_new_from_file ()

    GdaXmlConnection* gda_xml_connection_new_from_file
                                                (const gchar *filename);

Create a GdaXmlConnection object from the contents of `filename`, which must be a correct .connection file.

`filename` : | name of file to create the GdaXmlConnection object from.
Returns : | the newly created object.

### gda_xml_connection_new_from_string ()

    GdaXmlConnection* gda_xml_connection_new_from_string
                                                (const gchar *string);

Create a GdaXmlConnection object from the given XML string.

`string` : | XML string to create the GdaXmlConnection object from.
Returns : | the newly created object.

### gda_xml_connection_set_from_file ()

    gboolean    gda_xml_connection_set_from_file
                                                (GdaXmlConnection *xmlcnc,
                                                 const gchar *filename);

`xmlcnc` : |
`filename` : |
Returns : |

### gda_xml_connection_set_from_string ()

    gboolean    gda_xml_connection_set_from_string
                                                (GdaXmlConnection *xmlcnc,
                                                 const gchar *string);

Load a XML string into the given GdaXmlConnection object.

`xmlcnc` : | a GdaXmlConnection object.
`string` : | XML connection file contents.
Returns : | TRUE if successful, FALSE otherwise.

### gda_xml_connection_get_dsn ()

    const gchar* gda_xml_connection_get_dsn     (GdaXmlConnection *xmlcnc);

Get the data source name for the given GdaXmlConnection object.

`xmlcnc` : | a GdaXmlConnection object.
Returns : | the name of the data source.

### gda_xml_connection_set_dsn ()

    void        gda_xml_connection_set_dsn      (GdaXmlConnection *xmlcnc,
                                                 const gchar *dsn);

Set the data source name for the given GdaXmlConnection object.

`xmlcnc` : | a GdaXmlConnection object.
`dsn` : | data source name.

### gda_xml_connection_get_username ()

    const gchar* gda_xml_connection_get_username
                                                (GdaXmlConnection *xmlcnc);

Get the username defined in the GdaXmlConnection object.

`xmlcnc` : | a GdaXmlConnection object.
Returns : | the user name.

### gda_xml_connection_set_username ()

    void        gda_xml_connection_set_username (GdaXmlConnection *xmlcnc,
                                                 const gchar *username);

Set the user name for the given GdaXmlConnection object.

`xmlcnc` : | a GdaXmlConnection object.
`username` : | new user name.

### gda_xml_connection_get_password ()

    const gchar* gda_xml_connection_get_password
                                                (GdaXmlConnection *xmlcnc);

Get the password defined in the GdaXmlConnection object.

`xmlcnc` : | a GdaXmlConnection object.
Returns : | the password.

### gda_xml_connection_set_password ()

    void        gda_xml_connection_set_password (GdaXmlConnection *xmlcnc,
                                                 const gchar *password);

Set the password for the given GdaXmlConnection object.

`xmlcnc` : | a GdaXmlConnection object.
`password` : | new password.