MAK Data Logger API Documentation for HLA
sqlIfConnection.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 1992-2010 VT MAK
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 #pragma once
10 
11 #ifdef _WIN32
12 #include <windows.h>
13 #include <sqltypes.h>
14 #else
15 #include <sqltypes.h>
16 #endif
17 
18 #include "sqlIfError.h"
19 #include "databaseConnection.h"
20 
22 class DtSqlEnvironment;
23 
24 
25 //
26 // class DtSqlIfConnection:
27 //
28 // To talk to a database, you need to create a connection to it.
29 // DtSqlIfConnection is provided with an SQL environment handle, and creates
30 // a connection object. Once the connection object is created, you can then
31 // connect to a database. You can allocate a connection and environment
32 // directly and provide them as arguments to a DtSqlIfDatabase constructor,
33 // but it's easier to let the database object create both of these for you.
34 //
36 {
37 public:
38  // Main constructor
39  explicit DtSqlConnection( DtSqlEnvironment& environment);
40 
41  // Destructor
42  virtual ~DtSqlConnection();
43 
45  virtual void setConnectionParameters(DtDatabaseParameters* params, bool useMaster );
46 
47  // Make a connection to a database using the connection object created
48  // by this class at construction time
49  virtual bool connect();
50  virtual bool connectSansDSN();
51 
52  // Disconnect from the currently connected database
53  virtual bool disconnect();
54 
55  // Accessors/Mutators
56  // Return a handle to the connection object
57  SQLHDBC handle();
58 
59  // Returns true if we are currently connected to a DB, false otherwise
60  bool isConnected() const;
61 
62 protected:
63 
64  SQLHDBC myHandle;
69 };

Document ID: Generated on Sun Dec 15 18:04:30 EST 2013 from SVN revision 134418
Copyright © 2005-2012 VT MÄK. All Rights Reserved (www.mak.com)