File: sql-manager.h

package info (click to toggle)
tcl-sql 20000621-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 612 kB
  • ctags: 81
  • sloc: cpp: 399; makefile: 60; tcl: 19; csh: 2
file content (30 lines) | stat: -rw-r--r-- 619 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

#include "sql-mysql.h"
const int maxConns = 10;

class Manager_sql {
 private:
	Sql_interface *conns[maxConns];
	int nConnections;

	// Find the next unused connection slot (the next available slot
	// in 'conns' array).
	int findFreeConn();

  	// The last error message
	char *errmsg;

 public:
	Manager_sql();

	int connect(int argc, char **argv);
	int disconnect(int c);

	int inUse(int i) { if (conns[i]) return 1; else return 0; }

	Sql_interface *connection(int n) { if (n >= maxConns) return NULL; return conns[n]; }

	// Get the error message, if there was one, for the last message
	char *getErrorMsg();

};