00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef __ODBCCONNECTION_H
00013 #define __ODBCCONNECTION_H
00014
00015 #include <pthread.h>
00016 #include <sqltypes.h>
00017 #include <string>
00018
00019
00020 using namespace std;
00021
00025 class ODBCConnection
00026 {
00027 public:
00031 ODBCConnection();
00032
00036 ~ODBCConnection();
00037
00045 bool connect( string datasource, string user, string password );
00046
00050 SQLHDBC query();
00051
00055 void free( SQLHDBC hdbc );
00056
00061 void error( int lineno );
00062
00063 private:
00064 SQLHENV env;
00065 SQLHDBC hdbc;
00066 pthread_mutex_t mutex;
00067 pthread_cond_t cond;
00068 pthread_t thread;
00069 int lockCount;
00070 };
00071
00072 #endif