|
|
Choosing A Webhost: |
CVS update of odbsequoia/src (connect.cpp inst.hpp): msg#00119db.carob.cvs
Date: Wednesday, March 22, 2006 @ 18:28:59 Author: marc Path: /cvsroot/carob/odbsequoia/src Modified: connect.cpp (1.16 -> 1.17) inst.hpp (1.3 -> 1.4) Implemented new LogLevel setting in .ini file (mainly for carob) -------------+ connect.cpp | 16 ++++++++++++++++ inst.hpp | 1 + 2 files changed, 17 insertions(+) Index: odbsequoia/src/connect.cpp diff -u odbsequoia/src/connect.cpp:1.16 odbsequoia/src/connect.cpp:1.17 --- odbsequoia/src/connect.cpp:1.16 Wed Mar 22 16:03:52 2006 +++ odbsequoia/src/connect.cpp Wed Mar 22 18:28:59 2006 @@ -96,27 +96,43 @@ // BTW how could we fail when providing a default value? // Slurp DSN information from odbc.ini into ConnectionParameters + + /* Server host name/IP address */ if (0 >= SQLGetPrivateProfileString(cdsn, SERVER_INI, "localhost", temp, MAX_VALUE_LEN, ODBC_INI)) return SQL_ERROR; // TODO: diags. On the other hand it can hardly fail. std::wstring serverhost = fromString(std::string(temp)); + /* Port number */ if (0 >= SQLGetPrivateProfileString(cdsn, PORT_INI, "25322", temp, MAX_VALUE_LEN, ODBC_INI)) return SQL_ERROR; // TODO: diags. On the other hand it can hardly fail. in_port_t port = atoi(temp); + /* Virtual Database name (mandatory, no default) */ if (0 >= SQLGetPrivateProfileString(cdsn, DATABASE_INI, "", temp, MAX_VALUE_LEN, ODBC_INI)) throw ODBSeqException(L"???", L"'" WIDENMACRO(DATABASE_INI) L"'" L" parameter not found in .ini file"); std::wstring vdbname = fromString(std::string(temp)); + /* Prefix for diagnostics/exceptions/warnings coming from the backend */ if (0 >= SQLGetPrivateProfileString(cdsn, BACKEND_IDS_INI, DEFAULT_BACKEND_IDS_INI, temp, MAX_VALUE_LEN, ODBC_INI)) return SQL_ERROR; // TODO: diags. On the other hand it can hardly fail. this->backend_diagids = fromString(std::string(temp)); + /* Log level (mainly for carob) */ + if (0 >= SQLGetPrivateProfileString(cdsn, LOG_LEVEL_INI, "DEFAULTLOGLEVEL", + temp, MAX_VALUE_LEN, ODBC_INI)) + return SQL_ERROR; // TODO: diags. On the other hand it can hardly fail. + if (0 != std::string(temp).compare("DEFAULTLOGLEVEL")) + try { + setLogLevel(StringLogLevel(temp)); + } catch (const std::string& errmsg) { // unknown log level! + throw ODBSeqException(L"????", fromString(errmsg)); + } + #if 0 // see above delete[] cdsn; Index: odbsequoia/src/inst.hpp diff -u odbsequoia/src/inst.hpp:1.3 odbsequoia/src/inst.hpp:1.4 --- odbsequoia/src/inst.hpp:1.3 Thu Jan 19 17:39:36 2006 +++ odbsequoia/src/inst.hpp Wed Mar 22 18:28:59 2006 @@ -37,6 +37,7 @@ #define PORT_INI "Port" #define BACKEND_IDS_INI "BackendIdentifiers" #define DEFAULT_BACKEND_IDS_INI "[BackendIdentifiers undefined in INI file]" +#define LOG_LEVEL_INI "Loglevel" #endif // include only once
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | CVS update of carob/include (Common.hpp), marc-Tt5JLJuBijYiZlD9aYmxOGD2FQJk+8+b |
|---|---|
| Next by Date: | CVS update of odbsequoia/src (inst.hpp), marc-Tt5JLJuBijYiZlD9aYmxOGD2FQJk+8+b |
| Previous by Thread: | CVS update of odbsequoia/src (connect.cpp), marc-Tt5JLJuBijYiZlD9aYmxOGD2FQJk+8+b |
| Next by Thread: | CVS update of odbsequoia/src (connect.cpp inst.hpp), marc-Tt5JLJuBijYiZlD9aYmxOGD2FQJk+8+b |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |
Home
| advertise | OSDir is
an inevitable website.
|