--- /dev/null
+// 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 <oci.h>
+
+#include <anna/dbms.oracle/Descriptor.hpp>
+#include <anna/dbms.oracle/Database.hpp>
+#include <anna/dbms.oracle/Connection.hpp>
+#include <anna/dbms.oracle/ResultCode.hpp>
+
+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);
+ }
+}