src/Common/ODBC/MSSQLConnectionInfo.h

Go to the documentation of this file.
00001 #pragma once
00002 
00003 namespace AppSecInc
00004 {
00005         namespace Databases
00006         {
00007                 namespace MSSQL
00008                 {
00010             class MSSQLConnectionInfo : public AppSecInc::Databases::ODBC::ODBCConnectionInfo
00011                         {
00012                         protected:
00014                                 std::wstring _ipaddress;
00016                                 int _port;
00018                 AppSecInc::Databases::ODBC::ODBCConnectionProtocol _protocol;
00020                                 std::wstring _instancename;
00022                                 bool _trusted_auth;
00024                                 std::wstring _username;
00026                                 std::wstring _password;
00028                                 std::wstring _database;
00030                                 std::wstring _appname;
00032                                 std::wstring _namedpipe;
00033                         public:
00035                                 static LPCWSTR DEFAULT_IPADDRESS;
00037                                 static const int INVALID_PORT = -1;
00039                                 static const int DEFAULT_PORT = 1433;
00041                                 static LPCWSTR DefaultInstanceName;
00043                                 inline const std::wstring& GetIPAddress() const { return _ipaddress; }
00045                                 inline void SetIPAddress(const std::wstring& ipaddress) { _ipaddress = ipaddress; }
00047                                 inline int GetPort() const { return _port; }
00049                                 inline void SetPort(int port) { _port = port; }
00051                 inline AppSecInc::Databases::ODBC::ODBCConnectionProtocol GetProtocol() const { return _protocol; }
00053                 inline void SetProtocol(AppSecInc::Databases::ODBC::ODBCConnectionProtocol protocol) { _protocol = protocol; }
00055                                 inline bool GetTrustedAuth() const { return _trusted_auth; }
00057                                 inline void SetTrustedAuth(bool value) { _trusted_auth = value; }
00059                                 inline const std::wstring& GetUsername() const { return _username; }
00061                                 inline void SetUsername(const std::wstring& username) { _username = username; }
00063                                 inline const std::wstring& GetPassword() const { return _password; }
00065                                 inline void SetPassword(const std::wstring& password) { _password = password; }
00067                                 inline const std::wstring& GetDatabase() const { return _database; }
00069                                 inline void SetDatabase(const std::wstring& database) { _database = database; }
00071                                 inline const std::wstring& GetAppName() const { return _appname; }
00073                                 inline void SetAppName(const std::wstring& value) { _appname = value; }
00075                                 inline const std::wstring& GetInstanceName() const { return _instancename; }
00077                                 inline void SetInstanceName(const std::wstring& instancename) { _instancename = instancename; }
00079                                 inline const std::wstring& GetNamedPipeValue() const { return _namedpipe; }
00081                                 inline void SetNamedPipeValue(const std::wstring& namedpipe) { _namedpipe = namedpipe; }
00083                                 MSSQLConnectionInfo(const MSSQLConnectionInfo&);
00084                                 MSSQLConnectionInfo(
00085                                         const std::wstring& ipaddress = DEFAULT_IPADDRESS, 
00086                                         int port = DEFAULT_PORT);
00087                                 ~MSSQLConnectionInfo();
00088                                 void operator=(const MSSQLConnectionInfo&);
00090                 std::wstring GetConnectionString() const;
00091                         };
00092                 }
00093         }
00094 }


© Application Security Inc. - All Rights Reserved http://msiext.codeplex.com