1//
2// SessionImpl.cpp
3//
4// Library: Data
5// Package: DataCore
6// Module: SessionImpl
7//
8// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
9// and Contributors.
10//
11// SPDX-License-Identifier: BSL-1.0
12//
13
14
15#include "Poco/Data/SessionImpl.h"
16#include "Poco/Exception.h"
17
18
19namespace Poco {
20namespace Data {
21
22
23SessionImpl::SessionImpl(const std::string& rConnectionString, std::size_t timeout):
24 _connectionString(rConnectionString),
25 _loginTimeout(timeout)
26{
27}
28
29
30SessionImpl::~SessionImpl()
31{
32}
33
34
35void SessionImpl::reconnect()
36{
37 close();
38 open();
39}
40
41
42void SessionImpl::setConnectionString(const std::string& rConnectionString)
43{
44 if (isConnected())
45 throw Poco::InvalidAccessException("Can not change connection string on connected session."
46 " Close the session first.");
47
48 _connectionString = rConnectionString;
49}
50
51
52} } // namespace Poco::Data
53