Parameter.cpp 875 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //
  2. // Parameter.cpp
  3. //
  4. // Library: Data/ODBC
  5. // Package: ODBC
  6. // Module: Parameter
  7. //
  8. // Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
  9. // and Contributors.
  10. //
  11. // SPDX-License-Identifier: BSL-1.0
  12. //
  13. #include "Poco/Data/ODBC/Parameter.h"
  14. #include "Poco/Data/ODBC/Utility.h"
  15. #include "Poco/Data/ODBC/Error.h"
  16. #include "Poco/Data/ODBC/ODBCException.h"
  17. namespace Poco {
  18. namespace Data {
  19. namespace ODBC {
  20. Parameter::Parameter(const StatementHandle& rStmt, std::size_t colNum) :
  21. _rStmt(rStmt),
  22. _number(colNum)
  23. {
  24. init();
  25. }
  26. Parameter::~Parameter()
  27. {
  28. }
  29. void Parameter::init()
  30. {
  31. if (Utility::isError(SQLDescribeParam(_rStmt,
  32. (SQLUSMALLINT) _number + 1,
  33. &_dataType,
  34. &_columnSize,
  35. &_decimalDigits,
  36. &_isNullable)))
  37. {
  38. throw StatementException(_rStmt, "ODBC::Parameter::init():SQLDescribeParam()");
  39. }
  40. }
  41. } } } // namespace Poco::Data::ODBC