// close database bool FirebirdDatabaseLayer::Close() { CloseResultSets(); CloseStatements(); if (m_pDatabase) { if (m_pTransaction) { isc_tr_handle pTransaction = (isc_tr_handle)m_pTransaction; m_pInterface->GetIscRollbackTransaction()(*(ISC_STATUS_ARRAY*)m_pStatus, &pTransaction); m_pTransaction = NULL; } isc_db_handle pDatabase = (isc_db_handle)m_pDatabase; int nReturn = m_pInterface->GetIscDetachDatabase()(*(ISC_STATUS_ARRAY*)m_pStatus, &pDatabase); m_pDatabase = NULL; if (nReturn != 0) { InterpretErrorCodes(); ThrowDatabaseException(); return false; } } return true; }
// close database bool wxPostgresDatabase::Close() { CloseResultSets(); CloseStatements(); if (m_pDatabase) { m_pInterface->GetPQfinish()((PGconn*)m_pDatabase); m_pDatabase = NULL; } return true; }
// close database bool OTLDatabaseLayer::Close() { try { CloseResultSets(); CloseStatements(); //DeleteOTLStuff(); m_database.logoff(); } catch (otl_exception& e) { SetErrorCode(OTLDatabaseLayer::TranslateErrorCode(e.code)); SetErrorMessage(ConvertFromUnicodeStream((char*)e.msg)); ThrowDatabaseException(); return false; } return true; }
bool wxOdbcDatabase::Close() { ResetErrorCodes(); CloseResultSets(); CloseStatements(); if (m_bIsConnected) { SQLRETURN nRet = m_pInterface->GetSQLDisconnect()((SQLHDBC)m_sqlHDBC); if ( nRet != SQL_SUCCESS ) { InterpretErrorCodes( nRet ); ThrowDatabaseException(); } m_bIsConnected=false; } return true; }
// close database bool SqliteDatabaseLayer::Close() { ResetErrorCodes(); CloseResultSets(); CloseStatements(); if (m_pDatabase != NULL) { int nReturn = sqlite3_close((sqlite3*)m_pDatabase); if (nReturn != SQLITE_OK) { SetErrorCode(SqliteDatabaseLayer::TranslateErrorCode(sqlite3_errcode((sqlite3*)m_pDatabase))); SetErrorMessage(ConvertFromUnicodeStream(sqlite3_errmsg((sqlite3*)m_pDatabase))); ThrowDatabaseException(); return false; } m_pDatabase = NULL; } return true; }
// close database bool TdsDatabaseLayer::Close() { //puts("Resetting error codes"); ResetErrorCodes(); //puts("Closing result sets"); CloseResultSets(); //puts("Closing statements"); CloseStatements(); if (m_pDatabase != NULL) { //puts("Freeing socket"); tds_free_socket(m_pDatabase); m_pDatabase = NULL; } if (m_pLogin != NULL) { //puts("Freeing login"); tds_free_login(m_pLogin); m_pLogin = NULL; } if (m_pContext != NULL) { // Remove the context (and this databaselayer) from the lookup map // used by the error handler //puts("Removing TDS layer from hash"); TdsDatabaseLayer::RemoveTdsLayer(m_pContext); // Free the context //puts("Freeing context"); tds_free_context(m_pContext); m_pContext = NULL; } return true; }