Click here to Skip to main content
15,891,316 members
Articles / Programming Languages / Visual Basic

Oracle Advance Queue or Advanced Queuing from .NET (C#/VB/MC++)

Rate me:
Please Sign up or sign in to vote.
4.88/5 (26 votes)
22 Nov 2005CPOL23 min read 177.6K   3.7K   71  
How to use Oracle advance queue from a .NET enviroment.
//
//  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
//  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
//  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
//  PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER 
//  REMAINS UNCHANGED.
//
//  Email:  gustavo_franco@hotmail.com
//
//  Copyright (C) 2005 Franco, Gustavo 
//
#pragma once
#include "windows.h"
#include "stdio.h"
#include <iostream>
#include <process.h>		
#include <oracl.h>

#include "AQObjectDetails.h"
#include "AQObjectDetail.h"
#include "AQException.h"
#include "AQTools.h"
#include "AQManager.h"
#include "Enums.h"

using namespace System;
using namespace System::Runtime::InteropServices;
using namespace System::Reflection;
using namespace System::Collections;
using namespace System::Threading;
using namespace System::ComponentModel;
using namespace System::Diagnostics;
using namespace System::IO;
using namespace System::CodeDom;
using namespace System::CodeDom::Compiler;
using namespace Microsoft::CSharp;

#undef MessageBox
#undef CreateDirectory

namespace AQLib
{
	#ifndef __AQPublisher__
	#define __AQPublisher__
	public __gc class AQPublisher
	{
		private:
			static bool		mTracingEnabled;
			AQManager*		mAQManager;

			void			RecursiveDescribe(const char *name, OMetaData *pOMD, int level, AQObjectDetail* objectDescribe);
			void			CreateFileType(AQObjectDetail* oDetail, String* filePath, String* nameSpace);
			void			CreateFileCollection(AQObjectDetail* oDetail, String* filePath, String* nameSpace);

		protected:
			~AQPublisher();

		private public:
			static int		ERROR_DB_NOT_OPENED			= -4000;
			static String*	SERROR_DB_NOT_OPENED		= "Database is not open, call Open method first";
			static int		ERROR_QUERY_VIEW			= -4001;
			static String*	SERROR_QUERY_VIEW			= "Error to get records from [%1] view";
			static int		ERROR_QUEUE_NOT_FOUND		= -4002;
			static String*	SERROR_QUEUE_NOT_FOUND		= "Queue [%1] not found, check [%2] view for available queues";
			static int		ERROR_FIELD_NOT_FOUND		= -4003;
			static String*	SERROR_FIELD_NOT_FOUND		= "Field [%1] not found, check [%2] view";
			static int		ERROR_TYPE_NOT_FOUND		= -4004;
			static String*	SERROR_TYPE_NOT_FOUND		= "Type [%1] not found, check [%2] view for available Types";
			static int		ERROR_UNKNOW				= -9999;
			static String*	SERROR_UNKNOW				= "Unknow Error, Check for inner exception";

		public:
			AQPublisher();

			__property static bool get_TracingEnabled();
			__property static void set_TracingEnabled(bool enabled);

			void			Open(String *tnsServerName, String *userName, String *password);
			void			Close();
			String*			GetQueueNames()[];
			String*			GetQueueTypeName(String* queueName);
			AQObjectDetail* GetTypeDetail(String *dataTypeName);
			void			CreateFileType(AQObjectDetail* oDetail, String* filePath, String* nameSpace, bool recursive);
	};
	#endif
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer Microsoft
United States United States
I started with programming about 19 years ago as a teenager, from my old Commodore moving to PC/Server environment Windows/UNIX SQLServer/Oracle doing gwBasic, QBasic, Turbo Pascal, Assembler, Turbo C, BC, Summer87, Clipper, Fox, SQL, C/C++, Pro*C, VB3/5/6, Java, and today loving C#.

Currently working as SDE on Failover Clustering team for Microsoft.

Passion for most programming languages and my kids Aidan&Nadia.

Comments and Discussions