Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members  

ODBCConnection.h

00001 /*
00002    Copyright (C) 2002 the Strongroom project
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Lesser General Public
00006    License as published by the Free Software Foundation; either
00007    version 2.1 of the License, or (at your option) any later version.
00008 
00009    @author Ewald Snel
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

Generated on Wed Feb 18 13:45:55 2004 for strongroom by doxygen1.2.18