Click here to Skip to main content
15,895,084 members
Articles / Web Development / ASP.NET

Zeta Enterprise Library

Rate me:
Please Sign up or sign in to vote.
4.97/5 (14 votes)
16 Jan 2010CPOL3 min read 50.4K   2.3K   48  
A small set of general-purpose classes for using in .NET applications (2.0 or higher)
namespace Zeta.EnterpriseLibrary.Data.Oracle
{
	#region Using directives.
	// ----------------------------------------------------------------------

	using System;
	using System.Data.Common;
	using System.Data.OracleClient;
	using System.Runtime.InteropServices;
	using Base;

	// ----------------------------------------------------------------------
	#endregion

	/////////////////////////////////////////////////////////////////////////

	/// <summary>
	/// Helper class with statics, dealing with databases.
	/// </summary>
	/// <remarks>Parameters in the application configuration file (e.g. "<c>web.config</c>"):
	/// - "<c>_connectionString</c>": The connection string for connecting to the database.
	/// - "<c>traceSqlEnabled</c>": Turn tracing of SQL statements to LOG4NET on/off.
	/// - "<c>cacheSqlEnabled</c>": Turn caching of SQL statements and their result inside
	/// the ASP.NET web cache on/off.
	/// - "commandTimeoutSeconds": Define an optional timeout for a command to execute.
	/// This parameter is different from the connection timeout which
	/// can be defined inside the connection string.</remarks>
	[ComVisible( false )]
	public sealed class AdoNetOracleQuerier :
		AdoNetBaseQuerier<
			OracleCommand,
			OracleConnection,
			OracleDataAdapter,
			OracleParameter>
	{
		/// <summary>
		/// Creates the parameter collection.
		/// </summary>
		/// <param name="parameters">The parameters.</param>
		/// <returns></returns>
		public override IAdoNetParameterCollection CreateParameterCollection(
			DbParameter[] parameters )
		{
			return new AdoNetOracleParameterCollection( parameters );
		}

		public override IAdoNetTransactionScope CreateTransactionScope()
		{
			return new AdoNetOracleTransactionScope( this );
		}

		#region Abstracts to override.
		// ------------------------------------------------------------------

		/// <summary>
		/// Creates the updater.
		/// </summary>
		/// <returns></returns>
		public override IAdoNetUpdater CreateUpdater()
		{
			return new AdoNetOracleUpdater( this );
		}

		/// <summary>
		/// Must override, return NULL for none.
		/// </summary>
		/// <value></value>
		public override string QuotePrefix
		{
			get
			{
				return null;
			}
		}

		/// <summary>
		/// Must override, return NULL for none.
		/// </summary>
		/// <value></value>
		public override string QuoteSuffix
		{
			get
			{
				return null;
			}
		}

		/// <summary>
		/// Gets the identity select SQL.
		/// </summary>
		/// <param name="connection">The connection.</param>
		/// <param name="tableName">Name of the table.</param>
		/// <returns></returns>
		protected override string GetIdentitySelectSql(
			DbConnection connection,
			string tableName )
		{
			return string.Format(
				@"SELECT IDENT_CURRENT('{0}')",
				tableName );
		}

		/// <summary>
		/// Drops the table column.
		/// </summary>
		/// <param name="connectionString">The connection string.</param>
		/// <param name="tableName">Name of the table.</param>
		/// <param name="columnName">Name of the column.</param>
		public override void DropTableColumn(
			SmartConnectionString connectionString,
			string tableName,
			string columnName )
		{
			throw new NotImplementedException();
		}

		/// <summary>
		/// Drops the index.
		/// </summary>
		/// <param name="connectionString">The connection string.</param>
		/// <param name="tableName">Name of the table.</param>
		/// <param name="indexName">Name of the index.</param>
		public override void DropIndex(
			SmartConnectionString connectionString,
			string tableName,
			string indexName )
		{
			throw new NotImplementedException();
		}

		/// <summary>
		/// Drops all table constraints.
		/// </summary>
		/// <param name="connectionString">The connection string.</param>
		/// <param name="tableName">Name of the table.</param>
		public override void DropAllTableConstraints(
			SmartConnectionString connectionString,
			string tableName )
		{
			throw new NotImplementedException();
		}

		/// <summary>
		/// Determines whether the specified connection string contains constraint.
		/// </summary>
		/// <param name="connectionString">The connection string.</param>
		/// <param name="tableName">Name of the table.</param>
		/// <param name="constraintName">Name of the constraint.</param>
		/// <returns>
		/// 	<c>true</c> if the specified connection string contains constraint; otherwise, <c>false</c>.
		/// </returns>
		public override bool ContainsConstraint(
			SmartConnectionString connectionString,
			string tableName,
			string constraintName )
		{
			throw new NotImplementedException();
		}

		/// <summary>
		/// Determines whether the specified connection string contains index.
		/// </summary>
		/// <param name="connectionString">The connection string.</param>
		/// <param name="tableName">Name of the table.</param>
		/// <param name="indexName">Name of the index.</param>
		/// <returns>
		/// 	<c>true</c> if the specified connection string contains index; otherwise, <c>false</c>.
		/// </returns>
		public override bool ContainsIndex(
			SmartConnectionString connectionString,
			string tableName,
			string indexName )
		{
			throw new NotImplementedException();
		}

		/// <summary>
		/// Check whether a constrained is present.
		/// For creating and dropping constraints, see http://support.microsoft.com/?scid=kb%3Ben-us%3B291539.
		/// </summary>
		/// <param name="connectionString">The connection string.</param>
		/// <param name="tableName">Name of the table.</param>
		/// <param name="constraintName">Name of the constraint.</param>
		public override void DropConstraint(
			SmartConnectionString connectionString,
			string tableName,
			string constraintName )
		{
			throw new NotImplementedException();
		}

		// ------------------------------------------------------------------
		#endregion

		/// <summary>
		/// Formats a date time value so that it fits the appropriate specification
		/// for date formats to be usable from within a SQL query.
		/// </summary>
		/// <param name="dateToFormat">The date and time to format</param>
		/// <returns>Returns the ready-to-use SQL string.</returns>
		public override string FormatDateAndTime(
			DateTime dateToFormat )
		{
			throw new NotImplementedException();
		}

		/// <summary>
		/// Formats the date portion of a date time value so that it fits into
		/// the appropriate specification for date formats to be usable from within a SQL query.
		/// </summary>
		/// <param name="dateToFormat">The date and time to format</param>
		/// <returns>Returns the ready-to-use SQL string.</returns>
		public override string FormatDateOnly(
			DateTime dateToFormat )
		{
			throw new NotImplementedException();
		}

		/// <summary>
		/// Formats the time portion of a date time value so that it fits into
		/// the appropriate specification for date formats to be usable from within a SQL query.
		/// </summary>
		/// <param name="dateToFormat">The date and time to format</param>
		/// <returns>Returns the ready-to-use SQL string.</returns>
		public override string FormatTimeOnly(
			DateTime dateToFormat )
		{
			throw new NotImplementedException();
		}

		/// <summary>
		/// Gets or sets the lock object.
		/// </summary>
		/// <value>The lock object.</value>
		public override object LockObject
		{
			get
			{
				return null;
			}
			set
			{
				// Do nothing.
			}
		}
	}

	/////////////////////////////////////////////////////////////////////////
}

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
Chief Technology Officer Zeta Software GmbH
Germany Germany
Uwe does programming since 1989 with experiences in Assembler, C++, MFC and lots of web- and database stuff and now uses ASP.NET and C# extensively, too. He has also teached programming to students at the local university.

➡️ Give me a tip 🙂

In his free time, he does climbing, running and mountain biking. In 2012 he became a father of a cute boy and in 2014 of an awesome girl.

Some cool, free software from us:

Windows 10 Ereignisanzeige  
German Developer Community  
Free Test Management Software - Intuitive, competitive, Test Plans.  
Homepage erstellen - Intuitive, very easy to use.  
Offline-Homepage-Baukasten

Comments and Discussions