libpq.so.5: cannot open shared object file: No such file or directory
libdbi: Failed to load driver: /usr/lib/dbd/libdbdpgsql.so

Hi only want to comment this error mesage it is done because the posrgres
library is not install,
I check it installing and uninstalling that library.

I have installed mysql library and  myy program run correctly only this
message is error.

I attach my test code.
#include <stdio.h>
#include <dbi/dbi.h>

int main() {
    dbi_conn conn;
    dbi_result result;
    dbi_inst instance;

    double threshold = 4.333333;
    unsigned int idnumber;
    const char *name1,*name3;
    
    dbi_initialize_r(NULL, &instance);
    conn = dbi_conn_new_r("mysql", instance);

    dbi_conn_set_option(conn, "host", "192.168.0.101");
    dbi_conn_set_option(conn, "username", "develop");
    dbi_conn_set_option(conn, "password", "123456");
    dbi_conn_set_option(conn, "dbname", "sysapp.alpha");
    dbi_conn_set_option(conn, "encoding", "UTF-8");

    if (dbi_conn_connect(conn) < 0) {
      printf("Could not connect. Please check the option settings\n");
    }
    else {
      result = dbi_conn_query(conn, "SELECT name1, name3 FROM Persons");
    
      if (result) {
	while (dbi_result_next_row(result)) {
	  name1 = dbi_result_get_string(result, "name1");
	  name3 = dbi_result_get_string(result, "name3");
	  printf("%s %s\n", name1, name3);
	}
	dbi_result_free(result);
      }
      dbi_conn_close(conn);
    }
    
    dbi_shutdown_r(instance);

    return 0;
}
_______________________________________________
libdbi-users mailing list
libdbi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libdbi-users

Reply via email to