...
(pbs_db_conn_t *) pbs_db_connect(char *pbs_ds_host, int pbs_ds_port, int timeout, char **err_msg)
Parameters:
pbs_data_service_host[in]: Hostname information where the database is running.
...
timeout[in]: Timeout in seconds before the API will return if it is taking too long to connect.err_msg[out]: Connection/system messages generated by libdb. On connection failure out error messages.
Returns: Pointer to the initialized connection structure of type (pbs_db_conn_t *)
...
int pbs_db_disconnect(pbs_db_conn_t *conn, char **err_msg)
Parameters:
conn[in]: Connection structure with connection handler to the database which was created by pbs_db_connection.err_msg[out] : Connection logs/messages generated by libdb. On connecttion failure out error messages.
Returns: Returns status of the disconnection.
0 - for successful database disconnect.
1 - for failure
1.2.4. pbs_db_save_obj
...
savetype[in]: OBJ_SAVE_QS for quick save and OBJ_SAVE_NEW for insert.
Returns: Error code.
-1 - Execution of prepared statement failed.
...
obj[in]: PBS object information to be deleted. Based on the type defined within the obj structure, the right PBS object will be picked and dealt with.
Returns: Error code.
-1 - Failure
0 - Success
1 - Success but no rows deleted
...
conn[in] - The database connection handle which was created by pbs_db_connection..
obj[in/out] - PBS object information to be loaded from the database. Based on the type defined within obj structure, right PBS object will be picked and dealt with.
Returns: Error code
-1 - Failure
0 - Success
1 - Success but no rows loaded
...
query_cb[in]: Function pointer to a callback function that will process the each record returned by the database for the find query made.
Returns: Error code
-1 - Failure
0 - Success
1 - Success but no rows found
...
Returns: Error code
0 - Success
1 Non zero - On Failure
1.2.9. pbs_start_db
...
Signature:
int pbs_start_db(char **errmsg)
Parameters:
errmsg[out]: returns the startup error message if any
Returns: Error Returns: Error code
0 - Success
Non zero - On Failure
...
Signature:
int pbs_shutdown_db(char **errmsg)
...
errmsg[out]: returns the shutdown error message if any
Returns: Error code
0 - Success
...
Signature:
int pbs_status_db(char **errmsg)
Parameters:
errmsg[out]: returns the db error message if any
Returns: Error code
0 1 - Success
Non zero - On Failure
...
Database is down
2 - Database is starting
3 - Database is up
-1 - On Failure
1.2.12. pbs_db_password
Description: This API can be used to change the database user and password for the database instance.
...
conn[in]: The database connection handle which was created by pbs_db_connection.
user_name[in]: Databse Database user name.
password[in]: New password for the database.
...
0 - Success
Non zero - On Failure
1.2.12. get_db_errmsg
Description: This API can be used to get the error messages from the database library. When any of the above-listed APIs fail, this API can be used to get the error message from libdb.
Signature:
void get_db_errmsg(char **errmsg)
Parameters:
errmsg[out]: returns the db error message if any.