X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=source%2Fdbms.oracle%2FDescriptor.cpp;fp=source%2Fdbms.oracle%2FDescriptor.cpp;h=b7e501149e2e6f821e121695b441094cd56c99e6;hb=78be86969d2f26a9084b0c4af6ce43d5fa4ed3fd;hp=0000000000000000000000000000000000000000;hpb=a3b95648bd76140ef55e0b5941d423eee6c3856f;p=anna.git diff --git a/source/dbms.oracle/Descriptor.cpp b/source/dbms.oracle/Descriptor.cpp new file mode 100644 index 0000000..b7e5011 --- /dev/null +++ b/source/dbms.oracle/Descriptor.cpp @@ -0,0 +1,39 @@ +// ANNA - Anna is Not Nothingness Anymore // +// // +// (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo // +// // +// See project site at http://redmine.teslayout.com/projects/anna-suite // +// See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE // + + +#include + +#include +#include +#include +#include + +using namespace anna; + +dbms::oracle::Descriptor::~Descriptor() { + if(*reference != NULL) { + OCIDescriptorFree(*reference, type); + *reference = NULL; + } +} + +void dbms::oracle::Descriptor::allocate(dbms::oracle::Database& database, dbms::oracle::Connection* connection, const int _type) +throw(RuntimeException) { + if(*reference != NULL) + return; + + env = database; + error = database.getErrorHandler(); + context = *connection; // Invoca al operador de conversion + + try { + anna_dbms_oracle_check(OCIDescriptorAlloc(env, reference, type = _type, 0, 0), error); + } catch(DatabaseException& edb) { + throw RuntimeException(edb); + } +}