1 | // |
---|---|
2 | // Connector.cpp |
3 | // |
4 | // Library: Data/ODBC |
5 | // Package: ODBC |
6 | // Module: Connector |
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/ODBC/Connector.h" |
16 | #include "Poco/Data/ODBC/SessionImpl.h" |
17 | #include "Poco/Data/SessionFactory.h" |
18 | |
19 | |
20 | const ODBCConnectorRegistrator pocoODBCConnectorRegistrator; |
21 | |
22 | |
23 | namespace Poco { |
24 | namespace Data { |
25 | namespace ODBC { |
26 | |
27 | |
28 | const std::string Connector::KEY(POCO_DATA_ODBC_CONNECTOR_NAME); |
29 | |
30 | |
31 | Connector::Connector() |
32 | { |
33 | } |
34 | |
35 | |
36 | Connector::~Connector() |
37 | { |
38 | } |
39 | |
40 | |
41 | Poco::AutoPtr<Poco::Data::SessionImpl> Connector::createSession(const std::string& connectionString, |
42 | std::size_t timeout) |
43 | { |
44 | return Poco::AutoPtr<Poco::Data::SessionImpl>(new SessionImpl(connectionString, timeout)); |
45 | } |
46 | |
47 | |
48 | void Connector::registerConnector() |
49 | { |
50 | Poco::Data::SessionFactory::instance().add(new Connector()); |
51 | } |
52 | |
53 | |
54 | void Connector::unregisterConnector() |
55 | { |
56 | Poco::Data::SessionFactory::instance().remove(POCO_DATA_ODBC_CONNECTOR_NAME); |
57 | } |
58 | |
59 | |
60 | } } } // namespace Poco::Data::ODBC |
61 |