Ejemplo n.º 1
0
CTestLOB::CTestLOB(void)
{
    DBAPI_RegisterDriver_CTLIB();

    const CDBDefaultConnParams def_params("DBAPI_DEV1", "DBAPI_test", "allowed");
    const CCPPToolkitConnParams params(def_params);

    auto_ptr<I_DriverContext> dc(MakeDriverContext(params));
    m_Conn.reset(dc->MakeConnection(params));
}
Ejemplo n.º 2
0
IDataSource* CDriverManager::MakeDs(const CDBConnParams& params,
                                    const string&        tag)
{
    string tagged_name = params.GetDriverName() + tag;

    CMutexGuard mg(m_Mutex);

    TDsContainer::iterator i_ds = m_ds_list.find(tagged_name);
    if (i_ds != m_ds_list.end()) {
        return (*i_ds).second;
    }

    I_DriverContext* ctx = MakeDriverContext(params);

    CHECK_NCBI_DBAPI(
        !ctx,
        "CDriverManager::CreateDs() -- Failed to get context for driver: " + params.GetDriverName()
        );

    return RegisterDs(tagged_name, ctx);
}