Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge remote branch 'upstream/develop' into develop

  • Loading branch information...
commit 85fdb252386f1ff4a7667b20bd8722c55f1a8cb2 2 parents eab40cf + 6fa1270
@pprindeville authored
Showing with 621 additions and 517 deletions.
  1. +5 −1 .gitignore
  2. +5 −0 .travis.yml
  3. +7 −4 CMakeLists.txt
  4. +1 −0  CONTRIBUTORS
  5. +1 −1  Data/CMakeLists.txt
  6. +33 −33 Data/MySQL/testsuite/src/SQLExecutor.cpp
  7. +4 −0 Data/ODBC/ODBC.make
  8. +1 −1  Data/ODBC/include/Poco/Data/ODBC/Unicode_UNIXODBC.h
  9. +8 −16 Data/ODBC/include/Poco/Data/ODBC/Unicode_WIN32.h
  10. +3 −3 Data/ODBC/src/SessionImpl.cpp
  11. +21 −21 Data/ODBC/src/Unicode_UNIXODBC.cpp
  12. +18 −18 Data/ODBC/src/Unicode_WIN32.cpp
  13. +1 −1  Data/ODBC/testsuite/Makefile
  14. +138 −138 Data/ODBC/testsuite/src/SQLExecutor.cpp
  15. +2 −2 Data/ODBC/testsuite/src/SQLExecutor.h
  16. +1 −1  Data/SQLite/src/SessionImpl.cpp
  17. +12 −2 Data/include/Poco/Data/SessionFactory.h
  18. +1 −1  Data/include/Poco/Data/SessionImpl.h
  19. +1 −1  Data/include/Poco/Data/TypeHandler.h
  20. +6 −6 Data/samples/RowFormatter/src/RowFormatter.cpp
  21. +3 −3 Data/src/SessionFactory.cpp
  22. +14 −2 Foundation/include/Poco/Buffer.h
  23. +6 −6 Foundation/include/Poco/NumericString.h
  24. +31 −0 Foundation/include/Poco/Platform.h
  25. +3 −3 Foundation/include/Poco/Token.h
  26. +1 −1  Foundation/include/Poco/Version.h
  27. +30 −30 Foundation/src/NumberFormatter.cpp
  28. +2 −2 Foundation/src/NumericString.cpp
  29. +1 −1  Foundation/src/StringTokenizer.cpp
  30. +2 −9 Foundation/src/Token.cpp
  31. +4 −2 Foundation/testsuite/src/CoreTest.cpp
  32. +2 −2 Foundation/testsuite/src/StringTest.cpp
  33. +1 −1  JSON/src/Parser.cpp
  34. +2 −0  Net/Net_CE_vs90.vcproj
  35. +1 −0  Net/Net_vs100.vcxproj
  36. +3 −0  Net/Net_vs100.vcxproj.filters
  37. +1 −0  Net/Net_vs110.vcxproj
  38. +3 −0  Net/Net_vs110.vcxproj.filters
  39. +2 −0  Net/Net_vs71.vcproj
  40. +2 −0  Net/Net_vs80.vcproj
  41. +2 −0  Net/Net_vs90.vcproj
  42. +1 −0  Net/Net_x64_vs100.vcxproj
  43. +3 −0  Net/Net_x64_vs100.vcxproj.filters
  44. +1 −0  Net/Net_x64_vs110.vcxproj
  45. +3 −0  Net/Net_x64_vs110.vcxproj.filters
  46. +2 −0  Net/Net_x64_vs90.vcproj
  47. +25 −19 Net/include/Poco/Net/Net.h
  48. +18 −0 Net/include/Poco/Net/SMTPClientSession.h
  49. +0 −28 Net/src/DNS.cpp
  50. +0 −6 Net/src/IPAddress.cpp
  51. +117 −0 Net/src/Net.cpp
  52. +64 −14 Net/src/SMTPClientSession.cpp
  53. +0 −6 Net/src/SocketAddress.cpp
  54. +0 −9 Net/src/SocketImpl.cpp
  55. +1 −1  VERSION
  56. 0  {contrib → }/cmake/FindAPR.cmake
  57. 0  {contrib → }/cmake/FindApache2.cmake
  58. 0  {contrib → }/cmake/FindMySQL.cmake
  59. 0  {contrib → }/cmake/FindODBC.cmake
  60. 0  {contrib → }/cmake/FindPostgreSQL.cmake
  61. 0  {contrib → }/cmake/PocoConfig.cmake
  62. 0  {contrib → }/cmake/README
  63. 0  {contrib → }/cmake/cmake_uninstall.cmake.in
  64. +0 −121 contrib/cmake/CMakeLists.txt
  65. +1 −1  libversion
View
6 .gitignore
@@ -87,9 +87,13 @@ Thumbs.db
*.lastbuildstate
*.unsuccessfulbuild
release_shared/
-debug_share/
+debug_shared/
release_static/
debug_static/
+release_static_md/
+debug_static_md/
+release_static_mt/
+debug_static_mt/
bin/
bin64/
lib/
View
5 .travis.yml
@@ -0,0 +1,5 @@
+language: cpp
+compiler:
+ - gcc
+ - clang
+script: cmake .
View
11 CMakeLists.txt
@@ -23,6 +23,9 @@ SET(PROJECT_VERSION ${COMPLETE_VERSION})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
+# Append our module directory to CMake
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
+
#################################################################################
# Setup C/C++ compiler options
#################################################################################
@@ -98,9 +101,9 @@ include(FindCygwin)
include(FindOpenSSL)
#include(CMakeDetermineCompilerId)
-include(contrib/cmake/FindMySQL.cmake)
-include(contrib/cmake/FindAPR.cmake)
-include(contrib/cmake/FindApache2.cmake)
+include(FindMySQL)
+include(FindAPR)
+include(FindApache2)
# OS Detection
if(CMAKE_SYSTEM MATCHES "Windows")
@@ -179,7 +182,7 @@ endif(APRUTIL_FOUND AND APACHE_FOUND)
#############################################################
# Uninstall stuff see: http://www.vtk.org/Wiki/CMake_FAQ
CONFIGURE_FILE(
- "${CMAKE_CURRENT_SOURCE_DIR}/contrib/cmake/cmake_uninstall.cmake.in"
+ "${CMAKE_MODULE_PATH}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
View
1  CONTRIBUTORS
@@ -29,6 +29,7 @@ Fabrizio Duhem
Patrick White
Mike Naquin
Roger Meier
+Mathaus Mendel
--
$Id$
View
2  Data/CMakeLists.txt
@@ -31,7 +31,7 @@ if(MYSQL_FOUND)
add_subdirectory( MySQL )
endif(MYSQL_FOUND)
-include(../contrib/cmake/FindODBC.cmake)
+include(FindODBC)
if(CMAKE_SYSTEM MATCHES "Windows")
message(STATUS "Windows native ODBC Support Enabled")
View
66 Data/MySQL/testsuite/src/SQLExecutor.cpp
@@ -1695,15 +1695,15 @@ void SQLExecutor::sessionTransaction(const std::string& connect)
_pSession->begin();
assert (_pSession->isTransaction());
- try { (*_pSession) << "INSERT INTO PERSON VALUES (?,?,?,?)", use(lastNames), use(firstNames), use(addresses), use(ages), now; }
+ try { (*_pSession) << "INSERT INTO Person VALUES (?,?,?,?)", use(lastNames), use(firstNames), use(addresses), use(ages), now; }
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
assert (_pSession->isTransaction());
- local << "SELECT COUNT(*) FROM PERSON", into(locCount), now;
+ local << "SELECT COUNT(*) FROM Person", into(locCount), now;
assert (0 == locCount);
- try { (*_pSession) << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { (*_pSession) << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
assert (2 == count);
@@ -1711,31 +1711,31 @@ void SQLExecutor::sessionTransaction(const std::string& connect)
_pSession->rollback();
assert (!_pSession->isTransaction());
- local << "SELECT COUNT(*) FROM PERSON", into(locCount), now;
+ local << "SELECT COUNT(*) FROM Person", into(locCount), now;
assert (0 == locCount);
- try { (*_pSession) << "SELECT count(*) FROM PERSON", into(count), now; }
+ try { (*_pSession) << "SELECT count(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
assert (0 == count);
assert (!_pSession->isTransaction());
_pSession->begin();
- try { (*_pSession) << "INSERT INTO PERSON VALUES (?,?,?,?)", use(lastNames), use(firstNames), use(addresses), use(ages), now; }
+ try { (*_pSession) << "INSERT INTO Person VALUES (?,?,?,?)", use(lastNames), use(firstNames), use(addresses), use(ages), now; }
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
assert (_pSession->isTransaction());
- local << "SELECT COUNT(*) FROM PERSON", into(locCount), now;
+ local << "SELECT COUNT(*) FROM Person", into(locCount), now;
assert (0 == locCount);
_pSession->commit();
assert (!_pSession->isTransaction());
- local << "SELECT COUNT(*) FROM PERSON", into(locCount), now;
+ local << "SELECT COUNT(*) FROM Person", into(locCount), now;
assert (2 == locCount);
- try { (*_pSession) << "SELECT count(*) FROM PERSON", into(count), now; }
+ try { (*_pSession) << "SELECT count(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
assert (2 == count);
@@ -1788,14 +1788,14 @@ void SQLExecutor::transaction(const std::string& connect)
assert (trans.isActive());
assert (_pSession->isTransaction());
- try { (*_pSession) << "INSERT INTO PERSON VALUES (?,?,?,?)", use(lastNames), use(firstNames), use(addresses), use(ages), now; }
+ try { (*_pSession) << "INSERT INTO Person VALUES (?,?,?,?)", use(lastNames), use(firstNames), use(addresses), use(ages), now; }
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
assert (_pSession->isTransaction());
assert (trans.isActive());
- try { (*_pSession) << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { (*_pSession) << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
assert (2 == count);
@@ -1804,7 +1804,7 @@ void SQLExecutor::transaction(const std::string& connect)
}
assert (!_pSession->isTransaction());
- try { (*_pSession) << "SELECT count(*) FROM PERSON", into(count), now; }
+ try { (*_pSession) << "SELECT count(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
assert (0 == count);
@@ -1812,11 +1812,11 @@ void SQLExecutor::transaction(const std::string& connect)
{
Transaction trans((*_pSession));
- try { (*_pSession) << "INSERT INTO PERSON VALUES (?,?,?,?)", use(lastNames), use(firstNames), use(addresses), use(ages), now; }
+ try { (*_pSession) << "INSERT INTO Person VALUES (?,?,?,?)", use(lastNames), use(firstNames), use(addresses), use(ages), now; }
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
- local << "SELECT COUNT(*) FROM PERSON", into(locCount), now;
+ local << "SELECT COUNT(*) FROM Person", into(locCount), now;
assert (0 == locCount);
assert (_pSession->isTransaction());
@@ -1824,34 +1824,34 @@ void SQLExecutor::transaction(const std::string& connect)
trans.commit();
assert (!_pSession->isTransaction());
assert (!trans.isActive());
- local << "SELECT COUNT(*) FROM PERSON", into(locCount), now;
+ local << "SELECT COUNT(*) FROM Person", into(locCount), now;
assert (2 == locCount);
}
- try { (*_pSession) << "SELECT count(*) FROM PERSON", into(count), now; }
+ try { (*_pSession) << "SELECT count(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
assert (2 == count);
_pSession->begin();
- try { (*_pSession) << "DELETE FROM PERSON", now; }
+ try { (*_pSession) << "DELETE FROM Person", now; }
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
- local << "SELECT COUNT(*) FROM PERSON", into(locCount), now;
+ local << "SELECT COUNT(*) FROM Person", into(locCount), now;
assert (2 == locCount);
- try { (*_pSession) << "SELECT count(*) FROM PERSON", into(count), now; }
+ try { (*_pSession) << "SELECT count(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
assert (0 == count);
_pSession->commit();
- local << "SELECT COUNT(*) FROM PERSON", into(locCount), now;
+ local << "SELECT COUNT(*) FROM Person", into(locCount), now;
assert (0 == locCount);
- std::string sql1 = format("INSERT INTO PERSON VALUES ('%s','%s','%s',%d)", lastNames[0], firstNames[0], addresses[0], ages[0]);
- std::string sql2 = format("INSERT INTO PERSON VALUES ('%s','%s','%s',%d)", lastNames[1], firstNames[1], addresses[1], ages[1]);
+ std::string sql1 = format("INSERT INTO Person VALUES ('%s','%s','%s',%d)", lastNames[0], firstNames[0], addresses[0], ages[0]);
+ std::string sql2 = format("INSERT INTO Person VALUES ('%s','%s','%s',%d)", lastNames[1], firstNames[1], addresses[1], ages[1]);
std::vector<std::string> sql;
sql.push_back(sql1);
sql.push_back(sql2);
@@ -1859,35 +1859,35 @@ void SQLExecutor::transaction(const std::string& connect)
Transaction trans((*_pSession));
trans.execute(sql1, false);
- try { (*_pSession) << "SELECT count(*) FROM PERSON", into(count), now; }
+ try { (*_pSession) << "SELECT count(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
assert (1 == count);
trans.execute(sql2, false);
- try { (*_pSession) << "SELECT count(*) FROM PERSON", into(count), now; }
+ try { (*_pSession) << "SELECT count(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
assert (2 == count);
- local << "SELECT COUNT(*) FROM PERSON", into(locCount), now;
+ local << "SELECT COUNT(*) FROM Person", into(locCount), now;
assert (0 == locCount);
trans.rollback();
- local << "SELECT COUNT(*) FROM PERSON", into(locCount), now;
+ local << "SELECT COUNT(*) FROM Person", into(locCount), now;
assert (0 == locCount);
- try { (*_pSession) << "SELECT count(*) FROM PERSON", into(count), now; }
+ try { (*_pSession) << "SELECT count(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
assert (0 == count);
trans.execute(sql);
- local << "SELECT COUNT(*) FROM PERSON", into(locCount), now;
+ local << "SELECT COUNT(*) FROM Person", into(locCount), now;
assert (2 == locCount);
- try { (*_pSession) << "SELECT count(*) FROM PERSON", into(count), now; }
+ try { (*_pSession) << "SELECT count(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
assert (2 == count);
@@ -1906,12 +1906,12 @@ void SQLExecutor::reconnect()
int count = 0;
std::string result;
- try { (*_pSession) << "INSERT INTO PERSON VALUES (?,?,?,?)", use(lastName), use(firstName), use(address), use(age), now; }
+ try { (*_pSession) << "INSERT INTO Person VALUES (?,?,?,?)", use(lastName), use(firstName), use(address), use(age), now; }
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
count = 0;
- try { (*_pSession) << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { (*_pSession) << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
assert (count == 1);
@@ -1921,7 +1921,7 @@ void SQLExecutor::reconnect()
assert (!_pSession->isConnected());
try
{
- (*_pSession) << "SELECT LastName FROM PERSON", into(result), now;
+ (*_pSession) << "SELECT LastName FROM Person", into(result), now;
fail ("must fail");
}
catch(NotConnectedException&){ }
@@ -1929,7 +1929,7 @@ void SQLExecutor::reconnect()
_pSession->open();
assert (_pSession->isConnected());
- try { (*_pSession) << "SELECT Age FROM PERSON", into(count), now; }
+ try { (*_pSession) << "SELECT Age FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
assert (count == age);
View
4 Data/ODBC/ODBC.make
@@ -61,6 +61,10 @@ else ifeq (0, $(shell test -e $(POCO_ODBC_LIB)/libiodbc$(LIBLINKEXT); echo $$?))
SYSLIBS += -liodbc -liodbcinst
COMMONFLAGS += -DPOCO_IODBC -I/usr/include/iodbc
+# TODO: OSX >= 10.8 deprecated non-Unicode ODBC API functions, silence warnings until iODBC Unicode support
+COMMONFLAGS += -Wno-deprecated-declarations
+
else
$(error No ODBC library found. Please install unixODBC or iODBC or specify POCO_ODBC_LIB and try again)
endif
+
View
2  Data/ODBC/include/Poco/Data/ODBC/Unicode_UNIXODBC.h
@@ -56,7 +56,7 @@ inline void makeUTF16(SQLCHAR* pSQLChar, SQLSMALLINT length, std::string& target
}
-inline void makeUTF8(Poco::Buffer<SQLWCHAR>& buffer, int length, SQLPOINTER pTarget, SQLINTEGER targetLength);
+void makeUTF8(Poco::Buffer<SQLWCHAR>& buffer, SQLINTEGER length, SQLPOINTER pTarget, SQLINTEGER targetLength);
/// Utility function for conversion from UTF-16 to UTF-8.
View
24 Data/ODBC/include/Poco/Data/ODBC/Unicode_WIN32.h
@@ -42,7 +42,7 @@
namespace Poco {
namespace Data {
-namespace ODBC {
+namespace ODBC {
inline void makeUTF16(SQLCHAR* pSQLChar, SQLINTEGER length, std::wstring& target)
@@ -56,16 +56,15 @@ inline void makeUTF16(SQLCHAR* pSQLChar, SQLINTEGER length, std::wstring& target
}
-inline void makeUTF16(SQLCHAR* pSQLChar, SQLSMALLINT length, std::wstring& target)
- /// Utility function for conversion from UTF-8 to UTF-16.
+inline void makeUTF8(Poco::Buffer<wchar_t>& buffer, SQLINTEGER length, SQLPOINTER pTarget, SQLINTEGER targetLength)
+ /// Utility function for conversion from UTF-16 to UTF-8. Length is in bytes.
{
- makeUTF16(pSQLChar, (SQLINTEGER) length, target);
-}
-
+ if (buffer.sizeBytes() < length)
+ throw InvalidArgumentException("Specified length exceeds available length.");
+ else if ((length % 2) != 0)
+ throw InvalidArgumentException("Length must be an even number.");
-inline void makeUTF8(Poco::Buffer<wchar_t>& buffer, int length, SQLPOINTER pTarget, SQLINTEGER targetLength)
- /// Utility function for conversion from UTF-16 to UTF-8.
-{
+ length /= sizeof(wchar_t);
std::string result;
UnicodeConverter::toUTF8(buffer.begin(), length, result);
@@ -74,13 +73,6 @@ inline void makeUTF8(Poco::Buffer<wchar_t>& buffer, int length, SQLPOINTER pTarg
}
-inline void makeUTF8(Poco::Buffer<wchar_t>& buffer, int length, SQLPOINTER pTarget, SQLSMALLINT targetLength)
- /// Utility function for conversion from UTF-16 to UTF-8.
-{
- makeUTF8(buffer, length, pTarget, (SQLINTEGER) targetLength);
-}
-
-
} } } // namespace Poco::Data::ODBC
View
6 Data/ODBC/src/SessionImpl.cpp
@@ -55,7 +55,7 @@ SessionImpl::SessionImpl(const std::string& connect,
bool autoBind,
bool autoExtract):
Poco::Data::AbstractSessionImpl<SessionImpl>(connect, loginTimeout),
- _connector(toLower(Connector::KEY)),
+ _connector(Connector::KEY),
_maxFieldSize(maxFieldSize),
_autoBind(autoBind),
_autoExtract(autoExtract),
@@ -73,7 +73,7 @@ SessionImpl::SessionImpl(const std::string& connect,
bool enforceCapability,
bool autoBind,
bool autoExtract): Poco::Data::AbstractSessionImpl<SessionImpl>(connect),
- _connector(toLower(Connector::KEY)),
+ _connector(Connector::KEY),
_maxFieldSize(maxFieldSize),
_autoBind(autoBind),
_autoExtract(autoExtract),
@@ -218,7 +218,7 @@ bool SessionImpl::canTransact()
if (ODBC_TXN_CAPABILITY_UNKNOWN == _canTransact)
{
SQLUSMALLINT ret;
- checkError(Poco::Data::ODBC::SQLGetInfo(_db, SQL_TXN_CAPABLE, &ret, sizeof(ret), 0),
+ checkError(Poco::Data::ODBC::SQLGetInfo(_db, SQL_TXN_CAPABLE, &ret, 0, 0),
"Failed to obtain transaction capability info.");
_canTransact = (SQL_TC_NONE != ret) ?
View
42 Data/ODBC/src/Unicode_UNIXODBC.cpp
@@ -72,14 +72,14 @@ void makeUTF16(SQLCHAR* pSQLChar, SQLINTEGER length, std::string& target)
}
-void makeUTF8(Poco::Buffer<SQLWCHAR>& buffer, int length, SQLPOINTER pTarget, SQLINTEGER targetLength)
+void makeUTF8(Poco::Buffer<SQLWCHAR>& buffer, SQLINTEGER length, SQLPOINTER pTarget, SQLINTEGER targetLength)
{
UTF8Encoding utf8Encoding;
UTF16Encoding utf16Encoding;
TextConverter converter(utf16Encoding, utf8Encoding);
std::string result;
- if (0 != converter.convert(buffer.begin(), length * sizeof(SQLWCHAR), result))
+ if (0 != converter.convert(buffer.begin(), length, result))
throw DataFormatException("Error converting UTF-16 to UTF-8");
std::memset(pTarget, 0, targetLength);
@@ -103,7 +103,7 @@ SQLRETURN SQLColAttribute(SQLHSTMT hstmt,
iCol,
iField,
buffer.begin(),
- (SQLSMALLINT) buffer.size() * sizeof(SQLWCHAR),
+ (SQLSMALLINT) buffer.sizeBytes(),
pcbCharAttr,
pNumAttr);
@@ -157,8 +157,8 @@ SQLRETURN SQLConnect(SQLHDBC hdbc,
makeUTF16(szAuthStr, cbAuthStr, sqlPWD);
return SQLConnectW(hdbc,
- (SQLWCHAR*) sqlDSN.c_str(), cbDSN,
- (SQLWCHAR*) sqlUID.c_str(), cbUID,
+ (SQLWCHAR*) sqlDSN.c_str(), cbDSN,
+ (SQLWCHAR*) sqlUID.c_str(), cbUID,
(SQLWCHAR*) sqlPWD.c_str(), cbAuthStr);
}
@@ -184,7 +184,7 @@ SQLRETURN SQLDescribeCol(SQLHSTMT hstmt,
pibScale,
pfNullable);
- makeUTF8(buffer, *pcbColName, szColName, cbColNameMax);
+ makeUTF8(buffer, *pcbColName * sizeof(SQLWCHAR), szColName, cbColNameMax);
return rc;
}
@@ -227,7 +227,7 @@ SQLRETURN SQLGetConnectAttr(SQLHDBC hdbc,
SQLRETURN rc = SQLGetConnectAttrW(hdbc,
fAttribute,
buffer.begin(),
- (SQLINTEGER) buffer.size() * sizeof(SQLWCHAR),
+ (SQLINTEGER) buffer.sizeBytes(),
pcbValue);
makeUTF8(buffer, *pcbValue, rgbValue, cbValueMax);
@@ -293,7 +293,7 @@ SQLRETURN SQLGetDescField(SQLHDESC hdesc,
iRecord,
iField,
buffer.begin(),
- (SQLINTEGER) buffer.size() * sizeof(SQLWCHAR),
+ (SQLINTEGER) buffer.sizeBytes(),
pcbValue);
makeUTF8(buffer, *pcbValue, rgbValue, cbValueMax);
@@ -343,7 +343,7 @@ SQLRETURN SQLGetDiagField(SQLSMALLINT fHandleType,
iRecord,
fDiagField,
buffer.begin(),
- (SQLSMALLINT) buffer.size() * sizeof(SQLWCHAR),
+ (SQLSMALLINT) buffer.sizeBytes(),
pcbDiagInfo);
makeUTF8(buffer, *pcbDiagInfo, rgbDiagInfo, cbDiagInfoMax);
@@ -383,8 +383,8 @@ SQLRETURN SQLGetDiagRec(SQLSMALLINT fHandleType,
(SQLSMALLINT) bufErr.size(),
pcbErrorMsg);
- makeUTF8(bufState, stateLen, szSqlState, stateLen);
- makeUTF8(bufErr, *pcbErrorMsg, szErrorMsg, cbErrorMsgMax);
+ makeUTF8(bufState, stateLen * sizeof(SQLWCHAR), szSqlState, stateLen);
+ makeUTF8(bufErr, *pcbErrorMsg * sizeof(SQLWCHAR), szErrorMsg, cbErrorMsgMax);
return rc;
}
@@ -462,11 +462,11 @@ SQLRETURN SQLGetStmtAttr(SQLHSTMT hstmt,
return SQLGetStmtAttrW(hstmt,
fAttribute,
(SQLPOINTER) buffer.begin(),
- (SQLINTEGER) buffer.size() * sizeof(SQLWCHAR),
+ (SQLINTEGER) buffer.sizeBytes(),
pcbValue);
}
- return SQLGetStmtAttrW(hstmt, fAttribute, rgbValue, cbValueMax, pcbValue);
+ return SQLGetStmtAttrW(hstmt, fAttribute, rgbValue, cbValueMax, pcbValue);
}
@@ -505,7 +505,7 @@ SQLRETURN SQLGetInfo(SQLHDBC hdbc,
SQLRETURN rc = SQLGetInfoW(hdbc,
fInfoType,
(SQLPOINTER) buffer.begin(),
- (SQLSMALLINT) buffer.size() * sizeof(SQLWCHAR),
+ (SQLSMALLINT) buffer.sizeBytes(),
pcbInfoValue);
makeUTF8(buffer, *pcbInfoValue, rgbInfoValue, cbInfoValueMax);
@@ -595,8 +595,8 @@ SQLRETURN SQLDataSources(SQLHENV henv,
(SQLSMALLINT) bufDesc.size(),
pcbDesc);
- makeUTF8(bufDSN, *pcbDSN, szDSN, cbDSNMax);
- makeUTF8(bufDesc, *pcbDesc, szDesc, cbDescMax);
+ makeUTF8(bufDSN, *pcbDSN * sizeof(SQLWCHAR), szDSN, cbDSNMax);
+ makeUTF8(bufDesc, *pcbDesc * sizeof(SQLWCHAR), szDesc, cbDescMax);
return rc;
}
@@ -628,7 +628,7 @@ SQLRETURN SQLDriverConnect(SQLHDBC hdbc,
pcbConnStrOut,
fDriverCompletion);
- makeUTF8(out, *pcbConnStrOut, pcbConnStrOut, cbConnStrOutMax);
+ makeUTF8(out, *pcbConnStrOut * sizeof(SQLWCHAR), pcbConnStrOut, cbConnStrOutMax);
return rc;
}
@@ -653,7 +653,7 @@ SQLRETURN SQLBrowseConnect(SQLHDBC hdbc,
(SQLSMALLINT) bufConnStrOut.size(),
pcbConnStrOut);
- makeUTF8(bufConnStrOut, *pcbConnStrOut, szConnStrOut, cbConnStrOutMax);
+ makeUTF8(bufConnStrOut, *pcbConnStrOut * sizeof(SQLWCHAR), szConnStrOut, cbConnStrOutMax);
return rc;
}
@@ -710,7 +710,7 @@ SQLRETURN SQLNativeSql(SQLHDBC hdbc,
(SQLINTEGER) bufSQLOut.size(),
pcbSqlStr);
- makeUTF8(bufSQLOut, *pcbSqlStr, szSqlStr, cbSqlStrMax);
+ makeUTF8(bufSQLOut, *pcbSqlStr * sizeof(SQLWCHAR), szSqlStr, cbSqlStrMax);
return rc;
}
@@ -787,8 +787,8 @@ SQLRETURN SQLDrivers(SQLHENV henv,
(SQLSMALLINT) bufDriverAttr.size(),
pcbDrvrAttr);
- makeUTF8(bufDriverDesc, *pcbDriverDesc, szDriverDesc, cbDriverDescMax);
- makeUTF8(bufDriverAttr, *pcbDrvrAttr, szDriverAttributes, cbDrvrAttrMax);
+ makeUTF8(bufDriverDesc, *pcbDriverDesc * sizeof(SQLWCHAR), szDriverDesc, cbDriverDescMax);
+ makeUTF8(bufDriverAttr, *pcbDrvrAttr * sizeof(SQLWCHAR), szDriverAttributes, cbDrvrAttrMax);
return rc;
}
View
36 Data/ODBC/src/Unicode_WIN32.cpp
@@ -54,7 +54,7 @@ SQLRETURN SQLColAttribute(SQLHSTMT hstmt,
SQLUSMALLINT iCol,
SQLUSMALLINT iField,
SQLPOINTER pCharAttr,
- SQLSMALLINT cbCharAttrMax,
+ SQLSMALLINT cbCharAttrMax,
SQLSMALLINT* pcbCharAttr,
NumAttrPtrType pNumAttr)
{
@@ -66,7 +66,7 @@ SQLRETURN SQLColAttribute(SQLHSTMT hstmt,
iCol,
iField,
buffer.begin(),
- (SQLSMALLINT) buffer.size() * sizeof(wchar_t),
+ (SQLSMALLINT) buffer.sizeBytes(),
pcbCharAttr,
pNumAttr);
@@ -78,7 +78,7 @@ SQLRETURN SQLColAttribute(SQLHSTMT hstmt,
iCol,
iField,
pCharAttr,
- cbCharAttrMax,
+ cbCharAttrMax,
pcbCharAttr,
pNumAttr);
}
@@ -150,7 +150,7 @@ SQLRETURN SQLDescribeCol(SQLHSTMT hstmt,
pibScale,
pfNullable);
- makeUTF8(buffer, *pcbColName, szColName, cbColNameMax);
+ makeUTF8(buffer, *pcbColName * sizeof(wchar_t), szColName, cbColNameMax);
return rc;
}
@@ -195,7 +195,7 @@ SQLRETURN SQLGetConnectAttr(SQLHDBC hdbc,
SQLRETURN rc = SQLGetConnectAttrW(hdbc,
fAttribute,
buffer.begin(),
- (SQLINTEGER) buffer.size() * sizeof(wchar_t),
+ (SQLINTEGER) buffer.sizeBytes(),
pcbValue);
makeUTF8(buffer, *pcbValue, rgbValue, cbValueMax);
@@ -263,7 +263,7 @@ SQLRETURN SQLGetDescField(SQLHDESC hdesc,
iRecord,
iField,
buffer.begin(),
- (SQLINTEGER) buffer.size() * sizeof(wchar_t),
+ (SQLINTEGER) buffer.sizeBytes(),
pcbValue);
makeUTF8(buffer, *pcbValue, rgbValue, cbValueMax);
@@ -312,7 +312,7 @@ SQLRETURN SQLGetDiagField(SQLSMALLINT fHandleType,
iRecord,
fDiagField,
buffer.begin(),
- (SQLSMALLINT) buffer.size() * sizeof(wchar_t),
+ (SQLSMALLINT) buffer.sizeBytes(),
pcbDiagInfo);
makeUTF8(buffer, *pcbDiagInfo, rgbDiagInfo, cbDiagInfoMax);
@@ -351,8 +351,8 @@ SQLRETURN SQLGetDiagRec(SQLSMALLINT fHandleType,
(SQLSMALLINT) bufErr.size(),
pcbErrorMsg);
- makeUTF8(bufState, stateLen, szSqlState, stateLen);
- makeUTF8(bufErr, *pcbErrorMsg, szErrorMsg, cbErrorMsgMax);
+ makeUTF8(bufState, stateLen * sizeof(wchar_t), szSqlState, stateLen);
+ makeUTF8(bufErr, *pcbErrorMsg * sizeof(wchar_t), szErrorMsg, cbErrorMsgMax);
return rc;
}
@@ -438,7 +438,7 @@ SQLRETURN SQLGetStmtAttr(SQLHSTMT hstmt,
return SQLGetStmtAttrW(hstmt,
fAttribute,
(SQLPOINTER) buffer.begin(),
- (SQLINTEGER) buffer.size() * sizeof(wchar_t),
+ (SQLINTEGER) buffer.sizeBytes(),
pcbValue);
}
@@ -485,7 +485,7 @@ SQLRETURN SQLGetInfo(SQLHDBC hdbc,
SQLRETURN rc = SQLGetInfoW(hdbc,
fInfoType,
(SQLPOINTER) buffer.begin(),
- (SQLSMALLINT) buffer.size() * sizeof(wchar_t),
+ (SQLSMALLINT) buffer.sizeBytes(),
pcbInfoValue);
makeUTF8(buffer, *pcbInfoValue, rgbInfoValue, cbInfoValueMax);
@@ -579,8 +579,8 @@ SQLRETURN SQLDataSources(SQLHENV henv,
(SQLSMALLINT) bufDesc.size(),
pcbDesc);
- makeUTF8(bufDSN, *pcbDSN, szDSN, cbDSNMax);
- makeUTF8(bufDesc, *pcbDesc, szDesc, cbDescMax);
+ makeUTF8(bufDSN, *pcbDSN * sizeof(wchar_t), szDSN, cbDSNMax);
+ makeUTF8(bufDesc, *pcbDesc * sizeof(wchar_t), szDesc, cbDescMax);
return rc;
}
@@ -612,7 +612,7 @@ SQLRETURN SQLDriverConnect(SQLHDBC hdbc,
pcbConnStrOut,
fDriverCompletion);
- makeUTF8(bufOut, *pcbConnStrOut, szConnStrOut, cbConnStrOutMax);
+ makeUTF8(bufOut, *pcbConnStrOut * sizeof(wchar_t), szConnStrOut, cbConnStrOutMax);
return rc;
}
@@ -637,7 +637,7 @@ SQLRETURN SQLBrowseConnect(SQLHDBC hdbc,
(SQLSMALLINT) bufConnStrOut.size(),
pcbConnStrOut);
- makeUTF8(bufConnStrOut, *pcbConnStrOut, szConnStrOut, cbConnStrOutMax);
+ makeUTF8(bufConnStrOut, *pcbConnStrOut * sizeof(wchar_t), szConnStrOut, cbConnStrOutMax);
return rc;
}
@@ -694,7 +694,7 @@ SQLRETURN SQLNativeSql(SQLHDBC hdbc,
(SQLINTEGER) bufSQLOut.size(),
pcbSqlStr);
- makeUTF8(bufSQLOut, *pcbSqlStr, szSqlStr, cbSqlStrMax);
+ makeUTF8(bufSQLOut, *pcbSqlStr * sizeof(wchar_t), szSqlStr, cbSqlStrMax);
return rc;
}
@@ -771,8 +771,8 @@ SQLRETURN SQLDrivers(SQLHENV henv,
(SQLSMALLINT) bufDriverAttr.size(),
pcbDrvrAttr);
- makeUTF8(bufDriverDesc, *pcbDriverDesc, szDriverDesc, cbDriverDescMax);
- makeUTF8(bufDriverAttr, *pcbDrvrAttr, szDriverAttributes, cbDrvrAttrMax);
+ makeUTF8(bufDriverDesc, *pcbDriverDesc * sizeof(wchar_t), szDriverDesc, cbDriverDescMax);
+ makeUTF8(bufDriverAttr, *pcbDrvrAttr * sizeof(wchar_t), szDriverAttributes, cbDrvrAttrMax);
return rc;
}
View
2  Data/ODBC/testsuite/Makefile
@@ -30,7 +30,7 @@ objects = ODBCTestSuite Driver \
ODBCSQLiteTest ODBCSQLServerTest ODBCTest SQLExecutor
ifeq ($(POCO_CONFIG),MinGW)
- objects += ODBCAccessTest
+ objects += ODBCAccessTest
endif
target = testrunner
View
276 Data/ODBC/testsuite/src/SQLExecutor.cpp
@@ -968,22 +968,22 @@ void SQLExecutor::simpleAccess()
int count = 0;
std::string result;
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(lastName), use(firstName), use(address), use(age), now; }
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)", use(lastName), use(firstName), use(address), use(age), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
count = 0;
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == 1);
- try { session() << "SELECT LastName FROM PERSON", into(result), now; }
+ try { session() << "SELECT LastName FROM Person", into(result), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (lastName == result);
- try { session() << "SELECT Age FROM PERSON", into(count), now; }
+ try { session() << "SELECT Age FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == age);
@@ -996,22 +996,22 @@ void SQLExecutor::complexType()
Person p1("LN1", "FN1", "ADDR1", 1);
Person p2("LN2", "FN2", "ADDR2", 2);
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(p1), now; }
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)", use(p1), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(p2), now; }
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)", use(p2), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
int count = 0;
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == 2);
Person c1;
- try { session() << "SELECT * FROM PERSON WHERE LastName = 'LN1'", into(c1), now; }
+ try { session() << "SELECT * FROM Person WHERE LastName = 'LN1'", into(c1), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (c1 == p1);
@@ -1025,13 +1025,13 @@ void SQLExecutor::complexTypeTuple()
Person p2("LN2", "FN2", "ADDR2", 2);
Tuple<Person,Person> t(p1,p2);
- try { *_pSession << "INSERT INTO PERSON VALUES(?,?,?,?,?,?,?,?)", use(t), now; }
+ try { *_pSession << "INSERT INTO Person VALUES(?,?,?,?,?,?,?,?)", use(t), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
Tuple<Person,Person> ret;
assert (ret != t);
- try { *_pSession << "SELECT * FROM PERSON", into(ret), now; }
+ try { *_pSession << "SELECT * FROM Person", into(ret), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (ret == t);
@@ -1057,11 +1057,11 @@ void SQLExecutor::simpleAccessVector()
int count = 0;
std::string result;
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(lastNames), use(firstNames), use(addresses), use(ages), now; }
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)", use(lastNames), use(firstNames), use(addresses), use(ages), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == 2);
@@ -1070,7 +1070,7 @@ void SQLExecutor::simpleAccessVector()
std::vector<std::string> firstNamesR;
std::vector<std::string> addressesR;
std::vector<int> agesR;
- try { session() << "SELECT * FROM PERSON", into(lastNamesR), into(firstNamesR), into(addressesR), into(agesR), now; }
+ try { session() << "SELECT * FROM Person", into(lastNamesR), into(firstNamesR), into(addressesR), into(agesR), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (ages == agesR);
@@ -1087,18 +1087,18 @@ void SQLExecutor::complexTypeVector()
people.push_back(Person("LN1", "FN1", "ADDR1", 1));
people.push_back(Person("LN2", "FN2", "ADDR2", 2));
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(people), now; }
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)", use(people), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
int count = 0;
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == 2);
std::vector<Person> result;
- try { session() << "SELECT * FROM PERSON", into(result), now; }
+ try { session() << "SELECT * FROM Person", into(result), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (result == people);
@@ -1112,18 +1112,18 @@ void SQLExecutor::sharedPtrComplexTypeVector()
people.push_back(new Person("LN1", "FN1", "ADDR1", 1));
people.push_back(new Person("LN2", "FN2", "ADDR2", 2));
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(people), now; }
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)", use(people), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
int count = 0;
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == 2);
std::vector<Person> result;
- try { session() << "SELECT * FROM PERSON", into(result), now; }
+ try { session() << "SELECT * FROM Person", into(result), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (2 == result.size());
@@ -1139,18 +1139,18 @@ void SQLExecutor::autoPtrComplexTypeVector()
people.push_back(new RefCountedPerson("LN1", "FN1", "ADDR1", 1));
people.push_back(new RefCountedPerson("LN2", "FN2", "ADDR2", 2));
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(people), now; }
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)", use(people), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
int count = 0;
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == 2);
std::vector<Person> result;
- try { session() << "SELECT * FROM PERSON", into(result), now; }
+ try { session() << "SELECT * FROM Person", into(result), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (2 == result.size());
@@ -1233,11 +1233,11 @@ void SQLExecutor::simpleAccessList()
int count = 0;
std::string result;
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(lastNames), use(firstNames), use(addresses), use(ages), now; }
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)", use(lastNames), use(firstNames), use(addresses), use(ages), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == 2);
@@ -1246,7 +1246,7 @@ void SQLExecutor::simpleAccessList()
std::list<std::string> firstNamesR;
std::list<std::string> addressesR;
std::list<int> agesR;
- try { session() << "SELECT * FROM PERSON", into(lastNamesR), into(firstNamesR), into(addressesR), into(agesR), now; }
+ try { session() << "SELECT * FROM Person", into(lastNamesR), into(firstNamesR), into(addressesR), into(agesR), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (ages == agesR);
@@ -1263,18 +1263,18 @@ void SQLExecutor::complexTypeList()
people.push_back(Person("LN1", "FN1", "ADDR1", 1));
people.push_back(Person("LN2", "FN2", "ADDR2", 2));
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(people), now; }
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)", use(people), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
int count = 0;
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == 2);
std::list<Person> result;
- try { session() << "SELECT * FROM PERSON", into(result), now; }
+ try { session() << "SELECT * FROM Person", into(result), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (result == people);
@@ -1349,11 +1349,11 @@ void SQLExecutor::simpleAccessDeque()
int count = 0;
std::string result;
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(lastNames), use(firstNames), use(addresses), use(ages), now; }
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)", use(lastNames), use(firstNames), use(addresses), use(ages), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == 2);
@@ -1362,7 +1362,7 @@ void SQLExecutor::simpleAccessDeque()
std::deque<std::string> firstNamesR;
std::deque<std::string> addressesR;
std::deque<int> agesR;
- try { session() << "SELECT * FROM PERSON", into(lastNamesR), into(firstNamesR), into(addressesR), into(agesR), now; }
+ try { session() << "SELECT * FROM Person", into(lastNamesR), into(firstNamesR), into(addressesR), into(agesR), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (ages == agesR);
@@ -1379,18 +1379,18 @@ void SQLExecutor::complexTypeDeque()
people.push_back(Person("LN1", "FN1", "ADDR1", 1));
people.push_back(Person("LN2", "FN2", "ADDR2", 2));
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(people), now; }
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)", use(people), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
int count = 0;
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == 2);
std::deque<Person> result;
- try { session() << "SELECT * FROM PERSON", into(result), now; }
+ try { session() << "SELECT * FROM Person", into(result), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (result == people);
@@ -1847,10 +1847,10 @@ void SQLExecutor::setSimple()
int count = 0;
std::string result;
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(lastNames), use(firstNames), use(addresses), use(ages), now; }
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)", use(lastNames), use(firstNames), use(addresses), use(ages), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == 2);
@@ -1859,7 +1859,7 @@ void SQLExecutor::setSimple()
std::set<std::string> firstNamesR;
std::set<std::string> addressesR;
std::set<int> agesR;
- try { session() << "SELECT * FROM PERSON", into(lastNamesR), into(firstNamesR), into(addressesR), into(agesR), now; }
+ try { session() << "SELECT * FROM Person", into(lastNamesR), into(firstNamesR), into(addressesR), into(agesR), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (ages == agesR);
@@ -1876,17 +1876,17 @@ void SQLExecutor::setComplex()
people.insert(Person("LN1", "FN1", "ADDR1", 1));
people.insert(Person("LN2", "FN2", "ADDR2", 2));
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(people), now; }
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)", use(people), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
int count = 0;
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == 2);
std::set<Person> result;
- try { session() << "SELECT * FROM PERSON", into(result), now; }
+ try { session() << "SELECT * FROM Person", into(result), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (result == people);
@@ -1905,17 +1905,17 @@ void SQLExecutor::setComplexUnique()
Person p2("LN2", "FN2", "ADDR2", 2);
people.push_back(p2);
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(people), now; }
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)", use(people), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
int count = 0;
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == 5);
std::set<Person> result;
- try { session() << "SELECT * FROM PERSON", into(result), now; }
+ try { session() << "SELECT * FROM Person", into(result), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (result.size() == 2);
@@ -1942,10 +1942,10 @@ void SQLExecutor::multiSetSimple()
int count = 0;
std::string result;
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(lastNames), use(firstNames), use(addresses), use(ages), now; }
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)", use(lastNames), use(firstNames), use(addresses), use(ages), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == 2);
@@ -1954,7 +1954,7 @@ void SQLExecutor::multiSetSimple()
std::multiset<std::string> firstNamesR;
std::multiset<std::string> addressesR;
std::multiset<int> agesR;
- try { session() << "SELECT * FROM PERSON", into(lastNamesR), into(firstNamesR), into(addressesR), into(agesR), now; }
+ try { session() << "SELECT * FROM Person", into(lastNamesR), into(firstNamesR), into(addressesR), into(agesR), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (ages.size() == agesR.size());
@@ -1976,17 +1976,17 @@ void SQLExecutor::multiSetComplex()
Person p2("LN2", "FN2", "ADDR2", 2);
people.insert(p2);
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(people), now; }
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)", use(people), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
int count = 0;
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == 5);
std::multiset<Person> result;
- try { session() << "SELECT * FROM PERSON", into(result), now; }
+ try { session() << "SELECT * FROM Person", into(result), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (result.size() == people.size());
@@ -2002,17 +2002,17 @@ void SQLExecutor::mapComplex()
people.insert(std::make_pair("LN1", p1));
people.insert(std::make_pair("LN2", p2));
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(people), now; }
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)", use(people), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
int count = 0;
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == 2);
std::map<std::string, Person> result;
- try { session() << "SELECT * FROM PERSON", into(result), now; }
+ try { session() << "SELECT * FROM Person", into(result), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (result == people);
@@ -2031,17 +2031,17 @@ void SQLExecutor::mapComplexUnique()
people.insert(std::make_pair("LN1", p1));
people.insert(std::make_pair("LN2", p2));
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(people), now; }
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)", use(people), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
int count = 0;
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == 5);
std::map<std::string, Person> result;
- try { session() << "SELECT * FROM PERSON", into(result), now; }
+ try { session() << "SELECT * FROM Person", into(result), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (result.size() == 2);
@@ -2060,17 +2060,17 @@ void SQLExecutor::multiMapComplex()
people.insert(std::make_pair("LN1", p1));
people.insert(std::make_pair("LN2", p2));
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(people), now; }
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)", use(people), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
int count = 0;
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == 5);
std::multimap<std::string, Person> result;
- try { session() << "SELECT * FROM PERSON", into(result), now; }
+ try { session() << "SELECT * FROM Person", into(result), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (result.size() == people.size());
@@ -2086,16 +2086,16 @@ void SQLExecutor::selectIntoSingle()
people.insert(std::make_pair("LN1", p1));
people.insert(std::make_pair("LN2", p2));
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(people), now; }
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)", use(people), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
int count = 0;
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == 2);
Person result;
- try { session() << "SELECT * FROM PERSON ORDER BY LastName", into(result), limit(1), now; }// will return 1 object into one single result
+ try { session() << "SELECT * FROM Person ORDER BY LastName", into(result), limit(1), now; }// will return 1 object into one single result
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (result == p1);
@@ -2111,17 +2111,17 @@ void SQLExecutor::selectIntoSingleStep()
people.insert(std::make_pair("LN1", p1));
people.insert(std::make_pair("LN2", p2));
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(people), now; }
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)", use(people), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
int count = 0;
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == 2);
Person result;
- Statement stmt = (session() << "SELECT * FROM PERSON", into(result), limit(1));
+ Statement stmt = (session() << "SELECT * FROM Person", into(result), limit(1));
stmt.execute();
assert (result == p1);
assert (!stmt.done());
@@ -2140,18 +2140,18 @@ void SQLExecutor::selectIntoSingleFail()
people.insert(std::make_pair("LN1", p1));
people.insert(std::make_pair("LN2", p2));
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(people), now; }
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)", use(people), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
int count = 0;
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), limit(2, true), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), limit(2, true), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == 2);
Person result;
try
{
- session() << "SELECT * FROM PERSON", into(result), limit(1, true), now; // will fail now
+ session() << "SELECT * FROM Person", into(result), limit(1, true), now; // will fail now
fail("hardLimit is set: must fail");
}
catch(Poco::Data::LimitException&)
@@ -2169,19 +2169,19 @@ void SQLExecutor::lowerLimitOk()
people.insert(std::make_pair("LN1", p1));
people.insert(std::make_pair("LN1", p2));
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(people), now; }
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)", use(people), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
int count = 0;
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == 2);
Person result;
try
{
- session() << "SELECT * FROM PERSON", into(result), lowerLimit(2), now; // will return 2 objects into one single result but only room for one!
+ session() << "SELECT * FROM Person", into(result), lowerLimit(2), now; // will return 2 objects into one single result but only room for one!
fail("Not enough space for results");
}
catch(Poco::Exception&)
@@ -2199,17 +2199,17 @@ void SQLExecutor::singleSelect()
people.insert(std::make_pair("LN1", p1));
people.insert(std::make_pair("LN1", p2));
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(people), now; }
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)", use(people), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
int count = 0;
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == 2);
Person result;
- Statement stmt = (session() << "SELECT * FROM PERSON", into(result), limit(1));
+ Statement stmt = (session() << "SELECT * FROM Person", into(result), limit(1));
stmt.execute();
assert (result == p1);
assert (!stmt.done());
@@ -2228,18 +2228,18 @@ void SQLExecutor::lowerLimitFail()
people.insert(std::make_pair("LN1", p1));
people.insert(std::make_pair("LN1", p2));
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(people), now; }
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)", use(people), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
int count = 0;
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == 2);
Person result;
try
{
- session() << "SELECT * FROM PERSON", into(result), lowerLimit(3), now; // will fail
+ session() << "SELECT * FROM Person", into(result), lowerLimit(3), now; // will fail
fail("should fail. not enough data");
}
catch(Poco::Exception&)
@@ -2257,16 +2257,16 @@ void SQLExecutor::combinedLimits()
people.insert(std::make_pair("LN1", p1));
people.insert(std::make_pair("LN1", p2));
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(people), now; }
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)", use(people), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
int count = 0;
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == 2);
std::vector <Person> result;
- try { session() << "SELECT * FROM PERSON", into(result), lowerLimit(2), upperLimit(2), now; }// will return 2 objects
+ try { session() << "SELECT * FROM Person", into(result), lowerLimit(2), upperLimit(2), now; }// will return 2 objects
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (result.size() == 2);
@@ -2285,16 +2285,16 @@ void SQLExecutor::ranges()
people.insert(std::make_pair("LN1", p1));
people.insert(std::make_pair("LN1", p2));
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(people), now; }
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)", use(people), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
int count = 0;
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == 2);
std::vector <Person> result;
- try { session() << "SELECT * FROM PERSON", into(result), range(2, 2), now; }// will return 2 objects
+ try { session() << "SELECT * FROM Person", into(result), range(2, 2), now; }// will return 2 objects
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (result.size() == 2);
@@ -2312,18 +2312,18 @@ void SQLExecutor::combinedIllegalLimits()
people.insert(std::make_pair("LN1", p1));
people.insert(std::make_pair("LN1", p2));
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(people), now; }
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)", use(people), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
int count = 0;
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == 2);
Person result;
try
{
- session() << "SELECT * FROM PERSON", into(result), lowerLimit(3), upperLimit(2), now;
+ session() << "SELECT * FROM Person", into(result), lowerLimit(3), upperLimit(2), now;
fail("lower > upper is not allowed");
}
catch(LimitException&)
@@ -2341,18 +2341,18 @@ void SQLExecutor::illegalRange()
people.insert(std::make_pair("LN1", p1));
people.insert(std::make_pair("LN1", p2));
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(people), now; }
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)", use(people), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
int count = 0;
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == 2);
Person result;
try
{
- session() << "SELECT * FROM PERSON", into(result), range(3, 2), now;
+ session() << "SELECT * FROM Person", into(result), range(3, 2), now;
fail("lower > upper is not allowed");
}
catch(LimitException&)
@@ -2365,13 +2365,13 @@ void SQLExecutor::emptyDB()
{
std::string funct = "emptyDB()";
int count = 0;
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == 0);
Person result;
- Statement stmt = (session() << "SELECT * FROM PERSON", into(result), limit(1));
+ Statement stmt = (session() << "SELECT * FROM Person", into(result), limit(1));
stmt.execute();
assert (result.firstName.empty());
assert (stmt.done());
@@ -2391,7 +2391,7 @@ void SQLExecutor::blob(int bigSize, const std::string& blobPlaceholder)
use(lastName), use(firstName), use(address), use(img), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == 1);
@@ -2409,7 +2409,7 @@ void SQLExecutor::blob(int bigSize, const std::string& blobPlaceholder)
assert (big.size() == bigSize);
- try { session() << "DELETE FROM PERSON", now; }
+ try { session() << "DELETE FROM Person", now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
@@ -2434,9 +2434,9 @@ void SQLExecutor::blobStmt()
CLOB blob("0123456789", 10);
int count = 0;
- Statement ins = (session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(lastName), use(firstName), use(address), use(blob));
+ Statement ins = (session() << "INSERT INTO Person VALUES (?,?,?,?)", use(lastName), use(firstName), use(address), use(blob));
ins.execute();
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == 1);
@@ -2460,10 +2460,10 @@ void SQLExecutor::dateTime()
DateTime born(1965, 6, 18, 5, 35, 1);
int count = 0;
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(lastName), use(firstName), use(address), use(born), now; }
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)", use(lastName), use(firstName), use(address), use(born), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == 1);
@@ -2491,7 +2491,7 @@ void SQLExecutor::date()
Date bornDate(1965, 6, 18);
int count = 0;
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)",
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)",
use(lastName),
use(firstName),
use(address),
@@ -2499,7 +2499,7 @@ void SQLExecutor::date()
now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == 1);
@@ -2530,7 +2530,7 @@ void SQLExecutor::time()
Time bornTime (5, 35, 1);
int count = 0;
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)",
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)",
use(lastName),
use(firstName),
use(address),
@@ -2538,7 +2538,7 @@ void SQLExecutor::time()
now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == 1);
@@ -3510,14 +3510,14 @@ void SQLExecutor::sessionTransaction(const std::string& connect)
session().begin();
assert (session().isTransaction());
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(lastNames), use(firstNames), use(addresses), use(ages), now; }
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)", use(lastNames), use(firstNames), use(addresses), use(ages), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (session().isTransaction());
- Statement stmt = (local << "SELECT COUNT(*) FROM PERSON", into(locCount), async, now);
+ Statement stmt = (local << "SELECT COUNT(*) FROM Person", into(locCount), async, now);
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (2 == count);
@@ -3528,19 +3528,19 @@ void SQLExecutor::sessionTransaction(const std::string& connect)
stmt.wait();
assert (0 == locCount);
- try { session() << "SELECT count(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT count(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (0 == count);
assert (!session().isTransaction());
session().begin();
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(lastNames), use(firstNames), use(addresses), use(ages), now; }
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)", use(lastNames), use(firstNames), use(addresses), use(ages), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (session().isTransaction());
- Statement stmt1 = (local << "SELECT COUNT(*) FROM PERSON", into(locCount), async, now);
+ Statement stmt1 = (local << "SELECT COUNT(*) FROM Person", into(locCount), async, now);
session().commit();
assert (!session().isTransaction());
@@ -3548,7 +3548,7 @@ void SQLExecutor::sessionTransaction(const std::string& connect)
stmt1.wait();
assert (2 == locCount);
- try { session() << "SELECT count(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT count(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (2 == count);
@@ -3604,14 +3604,14 @@ void SQLExecutor::transaction(const std::string& connect)
assert (trans.isActive());
assert (session().isTransaction());
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(lastNames), use(firstNames), use(addresses), use(ages), now; }
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)", use(lastNames), use(firstNames), use(addresses), use(ages), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (session().isTransaction());
assert (trans.isActive());
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (2 == count);
@@ -3620,7 +3620,7 @@ void SQLExecutor::transaction(const std::string& connect)
}
assert (!session().isTransaction());
- try { session() << "SELECT count(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT count(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (0 == count);
@@ -3628,11 +3628,11 @@ void SQLExecutor::transaction(const std::string& connect)
{
Transaction trans(session());
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(lastNames), use(firstNames), use(addresses), use(ages), now; }
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)", use(lastNames), use(firstNames), use(addresses), use(ages), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
- Statement stmt1 = (local << "SELECT COUNT(*) FROM PERSON", into(locCount), async, now);
+ Statement stmt1 = (local << "SELECT COUNT(*) FROM Person", into(locCount), async, now);
assert (session().isTransaction());
assert (trans.isActive());
@@ -3644,18 +3644,18 @@ void SQLExecutor::transaction(const std::string& connect)
assert (2 == locCount);
}
- try { session() << "SELECT count(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT count(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (2 == count);
- try { session() << "DELETE FROM PERSON", now; }
+ try { session() << "DELETE FROM Person", now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
- Statement stmt1 = (local << "SELECT count(*) FROM PERSON", into(locCount), async, now);
+ Statement stmt1 = (local << "SELECT count(*) FROM Person", into(locCount), async, now);
- try { session() << "SELECT count(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT count(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (0 == count);
@@ -3671,12 +3671,12 @@ void SQLExecutor::transaction(const std::string& connect)
if (local.getTransactionIsolation() == Session::TRANSACTION_READ_COMMITTED)
{
stmt1.wait();
- local << "SELECT count(*) FROM PERSON", into(locCount), now;
+ local << "SELECT count(*) FROM Person", into(locCount), now;
assert (0 == locCount);
}
- std::string sql1 = format("INSERT INTO PERSON VALUES ('%s','%s','%s',%d)", lastNames[0], firstNames[0], addresses[0], ages[0]);
- std::string sql2 = format("INSERT INTO PERSON VALUES ('%s','%s','%s',%d)", lastNames[1], firstNames[1], addresses[1], ages[1]);
+ std::string sql1 = format("INSERT INTO Person VALUES ('%s','%s','%s',%d)", lastNames[0], firstNames[0], addresses[0], ages[0]);
+ std::string sql2 = format("INSERT INTO Person VALUES ('%s','%s','%s',%d)", lastNames[1], firstNames[1], addresses[1], ages[1]);
std::vector<std::string> sql;
sql.push_back(sql1);
sql.push_back(sql2);
@@ -3684,34 +3684,34 @@ void SQLExecutor::transaction(const std::string& connect)
Transaction trans(session());
trans.execute(sql1, false);
- try { session() << "SELECT count(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT count(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (1 == count);
trans.execute(sql2, false);
- try { session() << "SELECT count(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT count(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (2 == count);
- Statement stmt2 = (local << "SELECT COUNT(*) FROM PERSON", into(locCount), async, now);
+ Statement stmt2 = (local << "SELECT COUNT(*) FROM Person", into(locCount), async, now);
trans.rollback();
stmt2.wait();
assert (0 == locCount);
- try { session() << "SELECT count(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT count(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (0 == count);
trans.execute(sql);
- Statement stmt3 = (local << "SELECT COUNT(*) FROM PERSON", into(locCount), now);
+ Statement stmt3 = (local << "SELECT COUNT(*) FROM Person", into(locCount), now);
assert (2 == locCount);
- try { session() << "SELECT count(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT count(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (2 == count);
@@ -3724,7 +3724,7 @@ struct TestCommitTransactor
{
void operator () (Session& session) const
{
- session << "INSERT INTO PERSON VALUES ('lastName','firstName','address',10)", now;
+ session << "INSERT INTO Person VALUES ('lastName','firstName','address',10)", now;
}
};
@@ -3733,7 +3733,7 @@ struct TestRollbackTransactor
{
void operator () (Session& session) const
{
- session << "INSERT INTO PERSON VALUES ('lastName','firstName','address',10)", now;
+ session << "INSERT INTO Person VALUES ('lastName','firstName','address',10)", now;
throw Poco::Exception("test");
}
};
@@ -3751,16 +3751,16 @@ void SQLExecutor::transactor()
TestCommitTransactor ct;
Transaction t1(session(), ct);
- try { session() << "SELECT count(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT count(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (1 == count);
- try { session() << "DELETE FROM PERSON", now; session().commit();}
+ try { session() << "DELETE FROM Person", now; session().commit();}
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
- try { session() << "SELECT count(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT count(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (0 == count);
@@ -3772,7 +3772,7 @@ void SQLExecutor::transactor()
fail ("must fail");
} catch (Poco::Exception&) { }
- try { session() << "SELECT count(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT count(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (0 == count);
@@ -3785,7 +3785,7 @@ void SQLExecutor::transactor()
fail ("must fail");
} catch (Poco::Exception&) { }
- try { session() << "SELECT count(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT count(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (0 == count);
@@ -3798,7 +3798,7 @@ void SQLExecutor::transactor()
fail ("must fail");
} catch (Poco::Exception&) { }
- try { session() << "SELECT count(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT count(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (0 == count);
@@ -3811,7 +3811,7 @@ void SQLExecutor::transactor()
fail ("must fail");
} catch (Poco::Exception&) { }
- try { session() << "SELECT count(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT count(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (0 == count);
@@ -3880,12 +3880,12 @@ void SQLExecutor::reconnect()
int count = 0;
std::string result;
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(lastName), use(firstName), use(address), use(age), now; }
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)", use(lastName), use(firstName), use(address), use(age), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
count = 0;
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == 1);
@@ -3895,7 +3895,7 @@ void SQLExecutor::reconnect()
assert (!session().isConnected());
try
{
- session() << "SELECT LastName FROM PERSON", into(result), now;
+ session() << "SELECT LastName FROM Person", into(result), now;
fail ("must fail");
}
catch(NotConnectedException&){ }
@@ -3903,7 +3903,7 @@ void SQLExecutor::reconnect()
session().open();
assert (session().isConnected());
- try { session() << "SELECT Age FROM PERSON", into(count), now; }
+ try { session() << "SELECT Age FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == age);
View
4 Data/ODBC/testsuite/src/SQLExecutor.h
@@ -467,10 +467,10 @@ class SQLExecutor: public CppUnit::TestCase
C1 address(size, "Address");
C2 img(size, CLOB("0123456789", 10));
int count = 0;
- try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(lastName), use(firstName), use(address), use(img), now; }
+ try { session() << "INSERT INTO Person VALUES (?,?,?,?)", use(lastName), use(firstName), use(address), use(img), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
- try { session() << "SELECT COUNT(*) FROM PERSON", into(count), now; }
+ try { session() << "SELECT COUNT(*) FROM Person", into(count), now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
assert (count == size);
View
2  Data/SQLite/src/SessionImpl.cpp
@@ -60,7 +60,7 @@ const std::string SessionImpl::ABORT_TRANSACTION("ROLLBACK");
SessionImpl::SessionImpl(const std::string& fileName, std::size_t loginTimeout):
Poco::Data::AbstractSessionImpl<SessionImpl>(fileName, loginTimeout),
- _connector(toLower(Connector::KEY)),
+ _connector(Connector::KEY),
_pDB(0),
_connected(false),
_isTransaction(false)
View
14 Data/include/Poco/Data/SessionFactory.h
@@ -45,6 +45,7 @@
#include "Poco/Data/Session.h"
#include "Poco/Mutex.h"
#include "Poco/SharedPtr.h"
+#include "Poco/String.h"
#include <map>
@@ -71,6 +72,7 @@ class Data_API SessionFactory
/// Session ses("SQLite", "dummy.db");
{
public:
+
static SessionFactory& instance();
/// returns the static instance of the singleton.