|
1 | 1 | // Copyright (c) Microsoft Corporation. |
2 | 2 | // Licensed under the MIT license. |
3 | 3 |
|
4 | | -// Implements the Connection class declared in connection.h. |
5 | | -// This class wraps low-level ODBC operations like connect/disconnect, |
6 | | -// transaction control, and autocommit configuration. |
7 | | - |
8 | 4 | #include "connection.h" |
9 | 5 | #include <iostream> |
10 | 6 |
|
| 7 | +//------------------------------------------------------------------------------------------------- |
| 8 | +// Implements the Connection class declared in connection.h. |
| 9 | +// This class wraps low-level ODBC operations like connect/disconnect, |
| 10 | +// transaction control, and autocommit configuration. |
| 11 | +//------------------------------------------------------------------------------------------------- |
11 | 12 | Connection::Connection(const std::wstring& conn_str) : _conn_str(conn_str) {} |
12 | 13 |
|
13 | 14 | Connection::~Connection() { |
14 | | - close(); |
| 15 | + LOG("Connection destructor called"); |
| 16 | + close(); // Ensure the connection is closed when the object is destroyed. |
15 | 17 | } |
16 | 18 |
|
17 | 19 | SQLRETURN Connection::connect() { |
@@ -39,11 +41,11 @@ SQLRETURN Connection::end_transaction(SQLSMALLINT completion_type) { |
39 | 41 | } |
40 | 42 |
|
41 | 43 | SQLRETURN Connection::set_autocommit(bool enable) { |
42 | | - LOG("Setting autocommit mode C++"); |
| 44 | + LOG("Setting autocommit mode"); |
43 | 45 | // to be added |
44 | 46 | } |
45 | 47 |
|
46 | 48 | bool Connection::get_autocommit() const { |
47 | | - LOG("Getting autocommit mode C++"); |
| 49 | + LOG("Getting autocommit mode"); |
48 | 50 | // to be added |
49 | 51 | } |
0 commit comments