src/SqlException.h
branchv_0
changeset 35 cd9db43db120
parent 10 7da7173d84b0
child 36 91cb012d779a
equal deleted inserted replaced
34:24c05e69d68f 35:cd9db43db120
    15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
    15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
    16  */
    16  */
    17 #pragma once
    17 #pragma once
    18 
    18 
    19 #include <string>
    19 #include <string>
    20 
    20 #include <vector>
    21 using namespace std;
       
    22 
    21 
    23 namespace relpipe {
    22 namespace relpipe {
    24 namespace tr {
    23 namespace tr {
    25 namespace sql {
    24 namespace sql {
    26 
    25 
    27 class SqlException {
    26 class SqlException {
    28 private:
       
    29 	wstring message;
       
    30 public:
    27 public:
    31 
    28 
    32 	SqlException(wstring message) : message(message) {
    29 	class SqlDiagnosticsRecord {
    33 	}
    30 	public:
       
    31 		std::wstring sqlState;
       
    32 		int sqlCode;
       
    33 		std::wstring message;
       
    34 	};
    34 
    35 
    35 	wstring getMessge() {
    36 private:
    36 		return message;
    37 	std::wstring message;
    37 	}
    38 	std::vector<SqlDiagnosticsRecord> diagnostics;
       
    39 	signed short int resultCode;
       
    40 public:
       
    41 
       
    42 	SqlException(std::wstring message);
       
    43 
       
    44 	SqlException(std::wstring message, signed short int resultCode, signed short int handleType, void* handle);
       
    45 
       
    46 	std::wstring getMessage() const;
       
    47 
       
    48 	signed short int getResultCode() const;
       
    49 
       
    50 	std::vector<SqlDiagnosticsRecord> getDiagnostics() const;
    38 
    51 
    39 };
    52 };
    40 
    53 
    41 }
    54 }
    42 }
    55 }