日期:2014-05-18 浏览次数:20948 次
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OracleClient;
using CommLB.wmj.AllExceptionsCatch.ExceptionObjs;
namespace CommLB.wmj.AllDataProdivers.Command
{
/// <summary>
/// OracleDataProvider 的摘要说明
/// </summary>
internal class OracleDataProvider : CommLB.wmj.AllDataProdivers.CommandOfInterface.IDataProvider
{
private System.Data.OracleClient.OracleConnection oracleConnection;
private System.Data.OracleClient.OracleCommand oracleCommand;
private string connectionString;
public OracleDataProvider()
: this(null)
{
//
// TODO: 在此处添加构造函数逻辑
//
}
public OracleDataProvider(string connectionString)
{
if (connectionString == null || connectionString.Trim() == string.Empty)
{
System.Configuration.AppSettingsReader configurationAppSettings = new System.Configuration.AppSettingsReader();
this.connectionString = (string)(configurationAppSettings.GetValue("oracleConnectionString", typeof(string)));
}
else
{
this.connectionString = connectionString;
}
}
/// <summary>
/// Oracle 连接字符串 "User Id=southfence;Data Source=FENCEORA;Password=southfence;Persist Security Info=true;"
/// </summary>
public string ConnectionString
{
get
{
return this.connectionString;
}
set
{
this.connectionString = value;
}
}
/// <summary>
/// 返回一个带有连接字符串的Oracle Connection.
/// </summary>
/// <returns>OracleConnection </returns>
private OracleConnection GetOracleConnection()
{
try
{
return new OracleConnection(this.connectionString);
}
catch (Exception ex)
{
throw ex;
}
}
/// <summary>