libfq Documentation | |||
---|---|---|---|
Prev | Up | Chapter 3. libfq functions | Next |
The following functions handle connection initiation and termination to/from a Firebird backend server
FQconnect
Simple function to create a connection to a Firebird database providing only the database path, username and password.
FBconn * FQconnect(const char *db_path, const char *uname, const char *upass);
This is a wrapper around FQconnectdbParams
;
see that function for details about error handling.
FQconnectdbParams
Makes a new connection to the database server.
FBconn *FQconnectdbParams(const char * const *keywords, const char * const *values);
This function opens a new database connection using the parameters taken from two NULL-terminated arrays. The first, keywords, is defined as an array of strings, each one being a keyword. The second, values, gives the value for each keyword.
Following keywords are currently supported:
To determine if the connection was successful, call FQstatus
.
If the connection was not successful (CONNECTION_BAD is returned),
an error message containing more details can be retrieved with FQerrorMessage
.
Note that even if the connection was unsuccessful, the connection object should
be deallocated with FQclear
.
FQfinish
Closes the connection to the server. Also frees
memory used by the FBconn object.
Caller must not use the pointer again after FQfinish
has been called.
void FQfinish(FBconn *conn);