diff options
author | Alexander Köplinger <alex.koeplinger@outlook.com> | 2014-08-07 23:09:54 +0400 |
---|---|---|
committer | Alexander Köplinger <alex.koeplinger@outlook.com> | 2014-08-08 01:01:53 +0400 |
commit | c685b217646d271e70063173171a98159109ab2b (patch) | |
tree | ee128dabc576ca0cdebe4523dea6b0a3f4f0cbeb /mcs/class/System.Data.OracleClient | |
parent | 5f4b8c2cf4295e82196b0a93908638de9fce2992 (diff) |
[Cleanup] Removed files that imported Java namespaces
They were once part of a special Java target profile, but this is no longer used today.
Diffstat (limited to 'mcs/class/System.Data.OracleClient')
8 files changed, 0 insertions, 1640 deletions
diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleCommand.cs b/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleCommand.cs deleted file mode 100644 index 1e59ffcf3a8..00000000000 --- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleCommand.cs +++ /dev/null @@ -1,284 +0,0 @@ -//
-// System.Data.OracleClient.OracleCommand
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Collections;
-using System.Text;
-using System.Text.RegularExpressions;
-using System.Data;
-using System.Data.Common;
-using System.Data.ProviderBase;
-using System.Globalization;
-
-using java.sql;
-// Cannot use this because it makes ArrayList ambiguous reference
-//using java.util;
-#if !USE_DOTNET_REGEXP
-using java.util.regex;
-#endif
-
-namespace System.Data.OracleClient {
- public sealed class OracleCommand : AbstractDbCommand {
-
- #region Fields
-#if USE_DOTNET_REGEXP
- internal static readonly Regex NamedParameterStoredProcedureRegExp = new Regex(@"^\s*{?\s*((?<RETVAL>\:\w+)\s*=\s*)?call\s+(?<PROCNAME>(((\[[^\]]*\])|([^\.\(])*)\s*\.\s*){0,2}(\[[^\]]*\]|((\s*[^\.\(\)\{\}\s])+)))\s*(\(\s*(?<USERPARAM>((""([^""]|(""""))*"")|('([^']|(''))*')|[^,])*)?\s*(,\s*(?<USERPARAM>((""([^""]|(""""))*"")|('([^']|(''))*')|[^,])*)\s*)*\))?\s*}?\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture);
-#else
- internal static readonly Pattern NamedParameterStoredProcedureRegExp = Pattern.compile(@"^\s*\{?\s*(?:(\:\w+)\s*=\s*)?call\s+((?:(?:(?:\[[^\]]*\])|(?:[^\.\(\)\{\}\[\]])*)\s*\.\s*){0,2}(?:\[[^\]]*\]|(?:(?:\s*[^\.\(\)\{\}\[\]])+)))\s*(?:\((.*)\))?\s*\}?\s*$", Pattern.CASE_INSENSITIVE);
-#endif
- internal static readonly SimpleRegex NamedParameterRegExp = new OracleParamsRegex();
-
-// internal static readonly int oracleTypeRefCursor = java.sql.Types.OTHER;
-
- private int _currentParameterIndex = 0;
- private ResultSet _currentRefCursor;
-
- #endregion // Fields
-
- #region Constructors
-
- /**
- * Initializes a new instance of the OracleCommand class.
- * The base constructor initializes all fields to their default values.
- * The following table shows initial property values for an instance of SqlCommand.
- */
- public OracleCommand() : this(null, null, null) {
- }
-
- public OracleCommand(OracleConnection connection) : this(null, connection, null) {
- }
-
- /**
- * Initializes a new instance of the OracleCommand class with the text of the query.
- * @param cmdText The text of the query.
- */
- public OracleCommand(String cmdText) : this(cmdText, null, null) {
- }
-
- /**
- * Initializes a new instance of the OracleCommand class with the text of the query and a SqlConnection.
- * @param cmdText The text of the query.
- * @param connection A SqlConnection that represents the connection to an instance of SQL Server.
- */
- public OracleCommand(String cmdText, OracleConnection connection) : this(cmdText, connection, null) {
- }
-
- /**
- * Initializes a new instance of the OracleCommand class with the text of the query, a SqlConnection, and the Transaction.
- * @param cmdText The text of the query.
- * @param connection A SqlConnection that represents the connection to an instance of SQL Server.
- * @param transaction The SqlTransaction in which the OracleCommand executes.
- */
- public OracleCommand(
- String cmdText,
- OracleConnection connection,
- OracleTransaction transaction)
- : base(cmdText, connection, transaction) {
- }
-
- #endregion // Constructors
-
- #region Properties
-
- public new OracleConnection Connection {
- get { return (OracleConnection)base.Connection; }
- set { base.Connection = (AbstractDBConnection)value; }
- }
-
- public new OracleParameterCollection Parameters {
- get {
- return (OracleParameterCollection)base.Parameters;
- }
- }
-
- public new OracleTransaction Transaction {
- get { return (OracleTransaction)base.Transaction; }
- set { base.Transaction = (DbTransaction)value; }
- }
-
- protected override bool SkipParameter(DbParameter parameter) {
- return ((OracleParameter)parameter).OracleType == OracleType.Cursor;
- }
-
- protected sealed override ResultSet CurrentResultSet {
- get {
- try {
- ResultSet resultSet = base.CurrentResultSet;
-
- if (resultSet != null) {
- return resultSet;
- }
- return CurrentRefCursor;
- }
- catch(SQLException e) {
- throw CreateException(e);
- }
- }
- }
-
- private ResultSet CurrentRefCursor {
- get {
- if (_currentParameterIndex < 0) {
- NextRefCursor();
- }
- if (_currentRefCursor == null && _currentParameterIndex < InternalParameters.Count) {
- _currentRefCursor = (ResultSet)((CallableStatement)Statement).getObject(_currentParameterIndex + 1);
- }
- return _currentRefCursor;
- }
- }
-
-#if USE_DOTNET_REGEX
- protected override Regex StoredProcedureRegExp
-#else
- protected override java.util.regex.Pattern StoredProcedureRegExp {
-#endif
- get { return NamedParameterStoredProcedureRegExp; }
- }
-
- protected override SimpleRegex ParameterRegExp {
- get { return NamedParameterRegExp; }
- }
-
- #endregion // Properties
-
- #region Methods
-
- protected override bool NextResultSet() {
- try {
- bool hasMoreResults = base.NextResultSet();
-
- if (hasMoreResults) {
- return true;
- }
- else {
- return NextRefCursor();
- }
- }
- catch (SQLException e) {
- throw CreateException(e);
- }
- }
-
- private bool NextRefCursor() {
- _currentRefCursor = null;
- for (_currentParameterIndex++;InternalParameters.Count > _currentParameterIndex;_currentParameterIndex++) {
- OracleParameter param = (OracleParameter)InternalParameters[_currentParameterIndex];
- if (param.OracleType == OracleType.Cursor && ((param.Direction & ParameterDirection.Output) == ParameterDirection.Output))
- return true;
- }
- return false;
- }
-
- public new OracleDataReader ExecuteReader() {
- return (OracleDataReader)ExecuteReader(CommandBehavior.Default);
- }
-
- public new OracleDataReader ExecuteReader(CommandBehavior behavior) {
- return (OracleDataReader)base.ExecuteReader(behavior);
- }
-
- public new OracleParameter CreateParameter() {
- return (OracleParameter)CreateParameterInternal();
- }
-
- protected sealed override void CheckParameters() {
- //TBD
- }
-
- protected override AbstractDbParameter GetUserParameter(string parameterName, IList userParametersList, int userParametersListPosition) {
- for(int i=0; i < userParametersList.Count; i++) {
- OracleParameter userParameter = (OracleParameter)userParametersList[i];
- if (String.Compare(parameterName, userParameter.InternalPlaceholder.Trim(), true, CultureInfo.InvariantCulture) == 0) {
- return userParameter;
- }
- }
-
- return null;
- }
-
- protected override AbstractDbParameter GetReturnParameter (IList userParametersList) {
- for(int i=0; i < userParametersList.Count; i++) {
- AbstractDbParameter userParameter = (AbstractDbParameter)userParametersList[i];
- if (userParameter.Direction == ParameterDirection.ReturnValue) {
- return userParameter;
- }
- }
-
- return null;
- }
-
- protected sealed override DbParameter CreateParameterInternal() {
- return new OracleParameter();
- }
-
- protected sealed override DbParameterCollection CreateParameterCollection(AbstractDbCommand parent) {
- return new OracleParameterCollection((OracleCommand)parent);
- }
-
- public override object Clone() {
- OracleCommand clone = (OracleCommand)base.Clone();
- clone._currentParameterIndex = 0;
- clone._currentRefCursor = null;
- return clone;
- }
-
- protected override void PrepareInternalParameters() {
- InternalParameters.Clear();
- _currentParameterIndex = -1;
- }
-
-
- protected sealed override DbDataReader CreateReader() {
- return new OracleDataReader(this);
- }
-
- protected sealed override SystemException CreateException(SQLException e) {
- return new OracleException(e,Connection);
- }
-
- public object ExecuteOracleScalar() {
- throw new NotImplementedException();
- }
-
-#if SUPPORT_ORACLE_TYPES
- public int ExecuteOracleNonQuery(
- out OracleString rowid
- ) {
- throw new NotImplementedException();
- }
-#endif
-
- #endregion // Methods
-
- }
-}
\ No newline at end of file diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleConnection.cs b/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleConnection.cs deleted file mode 100644 index 6268f7e7577..00000000000 --- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleConnection.cs +++ /dev/null @@ -1,116 +0,0 @@ -//
-// System.Data.OracleClient.OracleConnection
-// -// Authors: -// Konstantin Triger <kostat@mainsoft.com> -// Boris Kirzner <borisk@mainsoft.com> -// -// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -//
-
-
-
-using System.Data;
-using System.Data.Common;
-using System.Data.ProviderBase;
-using System.Collections;
-
-using java.sql;
-
-using System.Configuration;
-using Mainsoft.Data.Configuration;
-using Mainsoft.Data.Jdbc.Providers;
-
-namespace System.Data.OracleClient {
- public sealed class OracleConnection : AbstractDBConnection, System.ICloneable {
- #region Events
-
- public event OracleInfoMessageEventHandler InfoMessage;
-
- #endregion // Events
-
- #region Constructors
-
- public OracleConnection() : this(null) {
- }
-
- public OracleConnection(String connectionString) : base(connectionString) {
- }
-
- #endregion // Constructors
-
- #region Methods
-
- protected override IConnectionProvider GetConnectionProvider() {
- IDictionary conProviderDict = ConnectionStringDictionary.Parse(ConnectionString);
- string provider = (string)conProviderDict["Provider"];
- if (provider == null)
- provider = "ORACLECLIENT";
-
- return GetConnectionProvider("Mainsoft.Data.Configuration/OracleClientProviders", provider);
- }
-
- public new OracleTransaction BeginTransaction(IsolationLevel level) {
- return new OracleTransaction(level, this);
- }
-
- public new OracleTransaction BeginTransaction() {
- return BeginTransaction(IsolationLevel.ReadCommitted);
- }
-
- public new OracleCommand CreateCommand() {
- return new OracleCommand(this);
- }
-
- protected override DbTransaction BeginDbTransaction(IsolationLevel isolationLevel) {
- return BeginTransaction();
- }
-
- protected override DbCommand CreateDbCommand() {
- return CreateCommand();
- }
-
- protected sealed override SystemException CreateException(SQLException e) {
- return new OracleException(e,this);
- }
-
- protected sealed override SystemException CreateException(string message) {
- return new OracleException(message, null, this);
- }
-
- protected sealed override void OnSqlWarning(SQLWarning warning) {
- OracleErrorCollection col = new OracleErrorCollection(warning, this);
- OnOracleInfoMessage(new OracleInfoMessageEventArgs(col));
- }
-
- private void OnOracleInfoMessage (OracleInfoMessageEventArgs value) { - if (InfoMessage != null) { - InfoMessage (this, value); - } - }
-
- #endregion // Methods
-
- }
-}
\ No newline at end of file diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleConvert.cs b/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleConvert.cs deleted file mode 100644 index e21da07a0f0..00000000000 --- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleConvert.cs +++ /dev/null @@ -1,453 +0,0 @@ -//
-// System.Data.Oracle.OracleConvert
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Collections;
-using System.Data.Common;
-using System.Data.ProviderBase;
-
-using java.sql;
-
-namespace System.Data.OracleClient {
- #region oracle.sql.Types constants
-
- internal enum JavaSqlTypes {
- ARRAY = 2003 ,
- BIGINT = -5,
- BINARY = -2 ,
- BIT = -7 ,
- BLOB = 2004,
- BOOLEAN = 16,
- CHAR = 1,
- CLOB = 2005,
- DATALINK = 70,
- DATE = 91,
- DECIMAL = 3,
- DISTINCT = 2001,
- DOUBLE = 8,
- FLOAT = 6,
- INTEGER = 4,
- JAVA_OBJECT = 2000,
- LONGVARBINARY = -4,
- LONGVARCHAR = -1,
- NULL = 0,
- NUMERIC = 2 ,
- OTHER = 1111 ,
- REAL = 7 ,
- REF = 2006 ,
- SMALLINT = 5,
- STRUCT = 2002,
- TIME = 92,
- TIMESTAMP = 93,
- TINYINT = -6,
- VARBINARY = -3,
- VARCHAR = 12,
-
- //ORACLE types, see oracle.jdbc.OracleTypes
- BINARY_FLOAT = 100,
- BINARY_DOUBLE = 101,
- ROWID = -8,
- CURSOR = -10,
- TIMESTAMPNS = -100,
- TIMESTAMPTZ = -101,
- TIMESTAMPLTZ = -102,
- INTERVALYM = -103,
- INTERVALDS = -104,
- }
-
- #endregion
- sealed class OracleConvert : DbConvert {
-
- #region .Net types constants
-
- internal static readonly Type TypeOfBoolean = typeof(Boolean);
- internal static readonly Type TypeOfSByte = typeof(SByte);
- internal static readonly Type TypeOfChar = typeof(Char);
- internal static readonly Type TypeOfInt16 = typeof(Int16);
- internal static readonly Type TypeOfInt32 = typeof(Int32);
- internal static readonly Type TypeOfInt64 = typeof(Int64);
- internal static readonly Type TypeOfByte = typeof(Byte);
- internal static readonly Type TypeOfUInt16 = typeof(UInt16);
- internal static readonly Type TypeOfUInt32 = typeof(UInt32);
- internal static readonly Type TypeOfUInt64 = typeof(UInt64);
- internal static readonly Type TypeOfDouble = typeof(Double);
- internal static readonly Type TypeOfSingle = typeof(Single);
- internal static readonly Type TypeOfDecimal = typeof(Decimal);
- internal static readonly Type TypeOfString = typeof(String);
- internal static readonly Type TypeOfDateTime = typeof(DateTime);
- internal static readonly Type TypeOfObject = typeof(object);
- internal static readonly Type TypeOfGuid = typeof(Guid);
- internal static readonly Type TypeOfType = typeof(Type);
-
- // additional types
- internal static readonly Type TypeOfByteArray = typeof(Byte[]);
- internal static readonly Type TypeOfCharArray = typeof(Char[]);
- internal static readonly Type TypeOfFloat = typeof (float);
- internal static readonly Type TypeOfTimespan = typeof (TimeSpan);
- static readonly Type TypeOfIDataReader = typeof(IDataReader);
-
- #endregion
-
- #region Methods
-
- internal static String JdbcTypeNameToDbTypeName(string jdbcTypeName) {
- return jdbcTypeName.Trim();;
- }
-
- internal static OracleType JdbcTypeToOracleType(int jdbcType) {
- switch ((JavaSqlTypes)jdbcType) {
- case JavaSqlTypes.ARRAY: return OracleType.Blob;
- case JavaSqlTypes.BIGINT: return OracleType.Number;
- case JavaSqlTypes.BINARY: return OracleType.Blob;
- case JavaSqlTypes.BIT: return OracleType.Byte;
- case JavaSqlTypes.BLOB: return OracleType.Blob;
- case JavaSqlTypes.BOOLEAN: return OracleType.Byte;
- case JavaSqlTypes.CHAR: return OracleType.Char;
- case JavaSqlTypes.CLOB: return OracleType.Clob;
-// case JavaSqlTypes.DATALINK: return OracleType.IUnknown;
- case JavaSqlTypes.DATE: return OracleType.DateTime;
- case JavaSqlTypes.DECIMAL: return OracleType.Number;
-// case JavaSqlTypes.DISTINCT: return OracleType.IUnknown;
- case JavaSqlTypes.DOUBLE: return OracleType.Double;
- case JavaSqlTypes.FLOAT: return OracleType.Float;
- case JavaSqlTypes.INTEGER: return OracleType.Int32;
-// case JavaSqlTypes.JAVA_OBJECT: return OracleType.IUnknown;
- case JavaSqlTypes.LONGVARBINARY: return OracleType.LongRaw;
- case JavaSqlTypes.LONGVARCHAR: return OracleType.LongVarChar;
-// case JavaSqlTypes.NULL: return OracleType.Empty;
- case JavaSqlTypes.NUMERIC: return OracleType.Number;
-// case JavaSqlTypes.OTHER: return OracleType.IUnknown;
-// case JavaSqlTypes.REAL: return OracleType.Single;
-// case JavaSqlTypes.REF: return OracleType.IUnknown;
- case JavaSqlTypes.SMALLINT: return OracleType.Int16;
-// case JavaSqlTypes.STRUCT: return OracleType.IUnknown;
- case JavaSqlTypes.TIME: return OracleType.TimestampLocal;
- case JavaSqlTypes.TIMESTAMP: return OracleType.Timestamp;
- case JavaSqlTypes.TINYINT: return OracleType.Byte;
- case JavaSqlTypes.VARBINARY: return OracleType.LongVarChar;
- default:
- case JavaSqlTypes.VARCHAR: return OracleType.VarChar;
-
- case JavaSqlTypes.BINARY_FLOAT: return OracleType.Float;
- case JavaSqlTypes.BINARY_DOUBLE: return OracleType.Double;
- case JavaSqlTypes.ROWID: return OracleType.RowId;
- case JavaSqlTypes.CURSOR: return OracleType.Cursor;
- case JavaSqlTypes.TIMESTAMPNS: return OracleType.Timestamp;
- case JavaSqlTypes.TIMESTAMPTZ: return OracleType.TimestampWithTZ;
- case JavaSqlTypes.TIMESTAMPLTZ: return OracleType.TimestampLocal;
- case JavaSqlTypes.INTERVALYM: return OracleType.IntervalYearToMonth;
- case JavaSqlTypes.INTERVALDS: return OracleType.IntervalDayToSecond;
- }
- }
-
- internal static OracleType ValueTypeToOracleType(Type type) {
- switch (Type.GetTypeCode(type)) {
- case TypeCode.Boolean: return OracleType.Byte;
- case TypeCode.Byte: return OracleType.Byte;
- case TypeCode.Char: return OracleType.Char;
- case TypeCode.DateTime: return OracleType.DateTime;
-// case TypeCode.DBNull: return OracleType.Empty;
- case TypeCode.Decimal: return OracleType.Number;
- case TypeCode.Double: return OracleType.Double;
-// case TypeCode.Empty: return OracleType.Empty;
- case TypeCode.Int16: return OracleType.Int16;
- case TypeCode.Int32: return OracleType.Int32;
- case TypeCode.Int64: return OracleType.Number;
- default:
- case TypeCode.Object: {
- if (type.Equals(TypeOfByteArray)) return OracleType.Blob;
- if (type.Equals(TypeOfTimespan)) return OracleType.Timestamp;
- if (type.IsSubclassOf(TypeOfIDataReader)) return OracleType.Cursor;
-// if (type.Equals(DbTypes.TypeOfGuid)) return OracleType.Guid;
-//
- if (type.IsEnum)
- return ValueTypeToOracleType (Enum.GetUnderlyingType (type));
-//
- return OracleType.VarChar;
- }
- case TypeCode.SByte: return OracleType.SByte;
- case TypeCode.Single: return OracleType.Float;
- case TypeCode.String: return OracleType.VarChar;
- case TypeCode.UInt16: return OracleType.UInt16;
- case TypeCode.UInt32: return OracleType.UInt32;
- case TypeCode.UInt64: return OracleType.Number;
- }
- }
-
- internal static Type OracleTypeToValueType(OracleType oleDbType) {
- switch (oleDbType) {
-// case OracleType.BigInt : return DbTypes.TypeOfInt64;// typeof(long);
-// case OracleType.Binary : return DbTypes.TypeOfByteArray;
-// case OracleType.Boolean : return DbTypes.TypeOfBoolean;
-// case OracleType.BSTR : return DbTypes.TypeOfString;
- case OracleType.BFile : return TypeOfByteArray;
- case OracleType.Blob : return TypeOfByteArray;
- case OracleType.Byte : return TypeOfByte;
- case OracleType.Char : return TypeOfString;
- case OracleType.Clob : return TypeOfCharArray;
- case OracleType.Cursor : return TypeOfIDataReader;
- case OracleType.DateTime : return TypeOfDateTime;
-// case OracleType.Currency : return TypeOfDecimal;
-// case OracleType.Date : return TypeOfDateTime;
-// case OracleType.DBDate : return TypeOfDateTime;
-// case OracleType.DBTime : return TypeOfTimespan;
-// case OracleType.DBTimeStamp : return TypeOfDateTime;
-// case OracleType.Decimal : return TypeOfDecimal;
- case OracleType.Double : return TypeOfDouble;
- case OracleType.Float : return TypeOfFloat;
- case OracleType.Int16 : return TypeOfInt16;
- case OracleType.Int32 : return TypeOfInt32;
- case OracleType.IntervalDayToSecond : return TypeOfTimespan;
- case OracleType.IntervalYearToMonth : return TypeOfInt32;
- case OracleType.LongRaw : return TypeOfByteArray;
-// case OracleType.Empty : return null; //typeof(DBNull);
-// case OracleType.Error : return typeof(Exception);
-// case OracleType.Filetime : return TypeOfDateTime;
-// case OracleType.Guid : return TypeOfGuid;
-// case OracleType.IDispatch : return TypeOfObject;
-// case OracleType.Integer : return TypeOfInt32;
-// case OracleType.IUnknown : return TypeOfObject;
-// case OracleType.LongVarBinary : return TypeOfByteArray;
- case OracleType.LongVarChar : return TypeOfString;
- case OracleType.NChar : return TypeOfString;
- case OracleType.NClob : return TypeOfString;
- case OracleType.Number : return TypeOfDecimal;
- case OracleType.NVarChar : return TypeOfString;
- case OracleType.Raw : return TypeOfByteArray;
-
- case OracleType.RowId : return TypeOfString;
- case OracleType.SByte : return TypeOfSByte;
- case OracleType.Timestamp : return TypeOfTimespan;
- case OracleType.TimestampLocal : return TypeOfTimespan;
- case OracleType.TimestampWithTZ : return TypeOfTimespan;
- case OracleType.UInt16 : return TypeOfUInt16;
-
- case OracleType.UInt32 : return TypeOfUInt32;
- case OracleType.VarChar : return TypeOfString;
-// case OracleType.LongVarWChar : return TypeOfString;
-// case OracleType.Numeric : return TypeOfDecimal;
-// case OracleType.PropVariant : return TypeOfObject;
-// case OracleType.Single : return TypeOfFloat;
-// case OracleType.SmallInt : return TypeOfInt16;
-// case OracleType.TinyInt : return TypeOfSByte;
-// case OracleType.UnsignedBigInt : return TypeOfUInt64;
-// case OracleType.UnsignedInt : return TypeOfUInt32;
-// case OracleType.UnsignedSmallInt : return TypeOfUInt16;
-// case OracleType.UnsignedTinyInt : return TypeOfByte;
-// case OracleType.VarBinary : return TypeOfByteArray;
-// case OracleType.VarChar : return TypeOfString;
-// case OracleType.Variant : return TypeOfObject;
-// case OracleType.VarNumeric : return TypeOfDecimal;
-// case OracleType.VarWChar : return TypeOfString;
-// case OracleType.WChar : return TypeOfString;
- default : return TypeOfObject;
- }
- }
-
- internal static OracleType DbTypeToOracleType(DbType dbType) {
- switch (dbType) {
- case DbType.AnsiString : return OracleType.VarChar;
- case DbType.Binary : return OracleType.Blob;
- case DbType.Byte : return OracleType.Byte;
- case DbType.Boolean : return OracleType.Byte;
- case DbType.Currency : return OracleType.Number;
- case DbType.Date : return OracleType.DateTime;
- case DbType.DateTime : return OracleType.DateTime;
- case DbType.Decimal : return OracleType.Number;
- case DbType.Double : return OracleType.Double;
- case DbType.Guid : return OracleType.Char;
- case DbType.Int16 : return OracleType.Int16;
- case DbType.Int32 : return OracleType.Int32;
- case DbType.Int64 : return OracleType.Number;
- case DbType.Object : return OracleType.Cursor;
- case DbType.SByte : return OracleType.SByte;
- case DbType.Single : return OracleType.Float;
- case DbType.String : return OracleType.VarChar;
- case DbType.Time : return OracleType.Timestamp;
- case DbType.UInt16 : return OracleType.UInt16;
- case DbType.UInt32 : return OracleType.UInt32;
- case DbType.UInt64 : return OracleType.Number;
- case DbType.VarNumeric : return OracleType.Number;
- case DbType.AnsiStringFixedLength : return OracleType.NChar;
- case DbType.StringFixedLength : return OracleType.Char;
- default : throw ExceptionHelper.InvalidDbType((int)dbType);
- }
- }
-
- internal static DbType OracleTypeToDbType(OracleType oleDbType) {
- switch (oleDbType) {
- case OracleType.BFile : return DbType.Binary;
- case OracleType.Blob : return DbType.Binary;
- case OracleType.Byte : return DbType.Byte;
- case OracleType.Char : return DbType.StringFixedLength;
- case OracleType.Clob : return DbType.String;
- case OracleType.Cursor : return DbType.Object;
- case OracleType.DateTime : return DbType.DateTime;
- case OracleType.Double : return DbType.Double;
- case OracleType.Float : return DbType.Single;
- case OracleType.Int16 : return DbType.Int16;
- case OracleType.Int32 : return DbType.Int32;
- case OracleType.IntervalDayToSecond : return DbType.Time;
- case OracleType.IntervalYearToMonth : return DbType.Int32;
- case OracleType.LongRaw : return DbType.Binary;
- case OracleType.LongVarChar : return DbType.String;
- case OracleType.NChar : return DbType.AnsiStringFixedLength;
- case OracleType.NClob : return DbType.AnsiString;
- case OracleType.Number : return DbType.VarNumeric;
- case OracleType.NVarChar : return DbType.AnsiString;
- case OracleType.Raw : return DbType.Binary;
-
- case OracleType.RowId : return DbType.AnsiStringFixedLength;
- case OracleType.SByte : return DbType.SByte;
- case OracleType.Timestamp : return DbType.Time;
- case OracleType.TimestampLocal : return DbType.Time;
- case OracleType.TimestampWithTZ : return DbType.Time;
- case OracleType.UInt16 : return DbType.UInt16;
-
- case OracleType.UInt32 : return DbType.UInt32;
- case OracleType.VarChar : return DbType.String;
-// case OracleType.Empty : return DbType.Object;
-// case OracleType.SmallInt : return DbType.Int16;
-// case OracleType.Integer : return DbType.Int32;
-// case OracleType.Single : return DbType.Single;
-// case OracleType.Double : return DbType.Double;
-// case OracleType.Currency : return DbType.Currency;
-// case OracleType.Date : return DbType.DateTime;
-// case OracleType.BSTR : return DbType.String;
-// case OracleType.IDispatch : return DbType.Object;
-// case OracleType.Error : return DbType.Object;
-// case OracleType.Boolean : return DbType.Boolean;
-// case OracleType.Variant : return DbType.Object;
-// case OracleType.IUnknown : return DbType.Object;
-// case OracleType.Decimal : return DbType.Decimal;
-// case OracleType.TinyInt : return DbType.SByte;
-// case OracleType.UnsignedTinyInt : return DbType.Byte;
-// case OracleType.UnsignedSmallInt : return DbType.UInt16;
-// case OracleType.UnsignedInt : return DbType.UInt32;
-// case OracleType.BigInt : return DbType.Int64;
-// case OracleType.UnsignedBigInt : return DbType.UInt64;
-// case OracleType.Filetime : return DbType.DateTime;
-// case OracleType.Guid : return DbType.Guid;
-// case OracleType.Binary : return DbType.Binary;
-// case OracleType.Char : return DbType.AnsiStringFixedLength;
-// case OracleType.WChar : return DbType.StringFixedLength;
-// case OracleType.Numeric : return DbType.Decimal;
-// case OracleType.DBDate : return DbType.Date;
-// case OracleType.DBTime : return DbType.Time;
-// case OracleType.DBTimeStamp : return DbType.DateTime;
-// case OracleType.PropVariant : return DbType.Object;
-// case OracleType.VarNumeric : return DbType.VarNumeric;
-// case OracleType.VarChar : return DbType.AnsiString;
-// case OracleType.LongVarChar : return DbType.AnsiString;
-// case OracleType.VarWChar : return DbType.String;
-// case OracleType.LongVarWChar : return DbType.String;
-// case OracleType.VarBinary : return DbType.Binary;
-// case OracleType.LongVarBinary : return DbType.Binary;
- default : throw ExceptionHelper.InvalidOleDbType((int)oleDbType);
- }
- }
-
- internal static int OracleTypeToJdbcType(OracleType oleDbType) {
- switch(oleDbType) {
- case OracleType.BFile : return (int)JavaSqlTypes.BINARY;
- case OracleType.Blob : return (int)JavaSqlTypes.BINARY;
- case OracleType.Byte : return (int)JavaSqlTypes.TINYINT;
- case OracleType.Char : return (int)JavaSqlTypes.CHAR;
- case OracleType.Clob : return (int)JavaSqlTypes.CLOB;
- case OracleType.Cursor : return (int)JavaSqlTypes.CURSOR;
- case OracleType.DateTime : return (int)JavaSqlTypes.TIMESTAMP;
- case OracleType.Double : return (int)JavaSqlTypes.DOUBLE;
- case OracleType.Float : return (int)JavaSqlTypes.FLOAT;
- case OracleType.Int16 : return (int)JavaSqlTypes.SMALLINT;
- case OracleType.Int32 : return (int)JavaSqlTypes.INTEGER;
- case OracleType.IntervalDayToSecond : return (int)JavaSqlTypes.INTERVALDS;
- case OracleType.IntervalYearToMonth : return (int)JavaSqlTypes.INTERVALYM;
- case OracleType.LongRaw : return (int)JavaSqlTypes.LONGVARBINARY;
- case OracleType.LongVarChar : return (int)JavaSqlTypes.LONGVARCHAR;
- case OracleType.NChar : return (int)JavaSqlTypes.CHAR;
- case OracleType.NClob : return (int)JavaSqlTypes.CLOB;
- case OracleType.Number : return (int)JavaSqlTypes.NUMERIC;
- case OracleType.NVarChar : return (int)JavaSqlTypes.VARCHAR;
- case OracleType.Raw : return (int)JavaSqlTypes.BINARY;
-
- case OracleType.RowId : return (int)JavaSqlTypes.VARCHAR;
- case OracleType.SByte : return (int)JavaSqlTypes.TINYINT;
- case OracleType.Timestamp : return (int)JavaSqlTypes.TIMESTAMP;
- case OracleType.TimestampLocal : return (int)JavaSqlTypes.TIMESTAMP;
- case OracleType.TimestampWithTZ : return (int)JavaSqlTypes.TIMESTAMP;
- case OracleType.UInt16 : return (int)JavaSqlTypes.SMALLINT;
-
- case OracleType.UInt32 : return (int)JavaSqlTypes.INTEGER;
- case OracleType.VarChar : return (int)JavaSqlTypes.VARCHAR;
-// case OracleType.BigInt : return Types.BIGINT;
-// case OracleType.Binary : return Types.BINARY;
-// case OracleType.Boolean : return Types.BIT;
-// case OracleType.BSTR : return Types.VARCHAR;
-// case OracleType.Char : return Types.CHAR;
-// case OracleType.Currency : return Types.DECIMAL;
-// case OracleType.Date : return Types.TIMESTAMP;
-// case OracleType.DBDate : return Types.DATE;
-// case OracleType.DBTime : return Types.TIME;
-// case OracleType.DBTimeStamp : return Types.TIMESTAMP;
-// case OracleType.Decimal : return Types.DECIMAL;
-// case OracleType.Double : return Types.DOUBLE;
-// case OracleType.Empty : return Types.NULL;
-// case OracleType.Error : return Types.OTHER;
-// case OracleType.Filetime : return Types.TIMESTAMP;
-// case OracleType.Guid : return Types.CHAR;
-// case OracleType.IDispatch : return Types.OTHER; //throw new ArgumentException("The " + oleDbType + " OracleType value is not supported.");
-// case OracleType.Integer : return Types.INTEGER;
-// case OracleType.IUnknown : return Types.OTHER; //throw new ArgumentException("The " + oleDbType + " OracleType value is not supported.");
-// case OracleType.LongVarBinary : return Types.LONGVARBINARY;
-// case OracleType.LongVarChar : return Types.LONGVARCHAR;
-// case OracleType.LongVarWChar : return Types.LONGVARCHAR;
-// case OracleType.Numeric : return Types.NUMERIC;
-// case OracleType.PropVariant : return Types.OTHER;
-// case OracleType.Single : return Types.FLOAT;
-// case OracleType.SmallInt : return Types.SMALLINT;
-// case OracleType.TinyInt : return Types.TINYINT;
-// case OracleType.UnsignedBigInt : return Types.BIGINT;
-// case OracleType.UnsignedInt : return Types.INTEGER;
-// case OracleType.UnsignedSmallInt : return Types.SMALLINT;
-// case OracleType.UnsignedTinyInt : return Types.TINYINT;
-// case OracleType.VarBinary : return Types.VARBINARY;
-// case OracleType.VarChar : return Types.VARCHAR;
-// case OracleType.Variant : return Types.VARCHAR;
-// case OracleType.VarNumeric : return Types.DECIMAL;
-// case OracleType.VarWChar : return Types.VARCHAR;
-// case OracleType.WChar : return Types.VARCHAR;
- default : throw ExceptionHelper.InvalidOleDbType((int)oleDbType);
- }
-
- #endregion // Methods
- }
- }
-}
diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleDataReader.cs b/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleDataReader.cs deleted file mode 100644 index 5c1fa39b70a..00000000000 --- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleDataReader.cs +++ /dev/null @@ -1,276 +0,0 @@ -//
-// System.Data.OracleClient.OracleDataReader
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Data.Common;
-using System.Data.ProviderBase;
-
-using java.sql;
-
-namespace System.Data.OracleClient {
- public sealed class OracleDataReader : AbstractDataReader {
- #region Fields
-
- #endregion // Fields
-
- #region Constructors
-
- internal OracleDataReader(OracleCommand command) : base(command) {
- }
-
- #endregion // Constructors
-
- #region Methods
-
- protected sealed override SystemException CreateException(string message, SQLException e) {
- return new OracleException(message,e, (OracleConnection)_command.Connection);
- }
-
- protected sealed override SystemException CreateException(java.io.IOException e) {
- return new OracleException(e, (OracleConnection)_command.Connection);
- }
-
- public override String GetDataTypeName(int columnIndex) {
- try {
- string jdbcTypeName = Results.getMetaData().getColumnTypeName(columnIndex + 1);
-
- return OracleConvert.JdbcTypeNameToDbTypeName(jdbcTypeName);
- }
- catch (SQLException e) {
- throw CreateException(e);
- }
- }
-
- protected override int GetProviderType(int jdbcType) {
- return (int)OracleConvert.JdbcTypeToOracleType(jdbcType);
- }
-
- protected override IReaderCacheContainer CreateReaderCacheContainer(int jdbcType, int columnIndex) {
- switch ((JavaSqlTypes)jdbcType) {
- case JavaSqlTypes.BINARY_FLOAT:
- jdbcType = (int)JavaSqlTypes.REAL;
- break;
- case JavaSqlTypes.BINARY_DOUBLE:
- jdbcType = (int)JavaSqlTypes.DOUBLE;
- break;
- case JavaSqlTypes.ROWID:
- jdbcType = (int)JavaSqlTypes.VARCHAR;
- break;
-// case JavaSqlTypes.CURSOR:
-// jdbcType = JavaSqlTypes.OTHER;
-// break;
- case JavaSqlTypes.TIMESTAMPNS:
- jdbcType = (int)JavaSqlTypes.TIMESTAMP;
- break;
- case JavaSqlTypes.TIMESTAMPTZ:
- jdbcType = (int)JavaSqlTypes.TIMESTAMP;
- break;
- case JavaSqlTypes.TIMESTAMPLTZ:
- jdbcType = (int)JavaSqlTypes.TIMESTAMP;
- break;
- case JavaSqlTypes.INTERVALYM:
- jdbcType = (int)JavaSqlTypes.INTEGER;
- break;
- case JavaSqlTypes.INTERVALDS:
- jdbcType = (int)JavaSqlTypes.TIMESTAMP;
- break;
- }
- return base.CreateReaderCacheContainer (jdbcType, columnIndex);
- }
-
-
- protected override void SetSchemaType(DataRow schemaRow, ResultSetMetaData metaData, int columnIndex) {
- JavaSqlTypes columnType = (JavaSqlTypes)metaData.getColumnType(columnIndex);
- switch (columnType) {
- case JavaSqlTypes.BINARY_FLOAT:
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);
- schemaRow [(int)SCHEMA_TABLE.DataType] = OracleConvert.TypeOfFloat;
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;
- break;
- case JavaSqlTypes.BINARY_DOUBLE:
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);
- schemaRow [(int)SCHEMA_TABLE.DataType] = OracleConvert.TypeOfDouble;
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;
- break;
- case JavaSqlTypes.ROWID:
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);
- schemaRow [(int)SCHEMA_TABLE.DataType] = OracleConvert.TypeOfString;
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;
- break;
- case JavaSqlTypes.CURSOR:
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);
- schemaRow [(int)SCHEMA_TABLE.DataType] = OracleConvert.TypeOfDouble;
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;
- break;
- case JavaSqlTypes.TIMESTAMPNS:
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);
- schemaRow [(int)SCHEMA_TABLE.DataType] = OracleConvert.TypeOfTimespan;
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;
- break;
- case JavaSqlTypes.TIMESTAMPTZ:
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);
- schemaRow [(int)SCHEMA_TABLE.DataType] = OracleConvert.TypeOfTimespan;
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;
- break;
- case JavaSqlTypes.TIMESTAMPLTZ:
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);
- schemaRow [(int)SCHEMA_TABLE.DataType] = OracleConvert.TypeOfTimespan;
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;
- break;
- case JavaSqlTypes.INTERVALYM:
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);
- schemaRow [(int)SCHEMA_TABLE.DataType] = OracleConvert.TypeOfUInt32;
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;
- break;
- case JavaSqlTypes.INTERVALDS:
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);
- schemaRow [(int)SCHEMA_TABLE.DataType] = OracleConvert.TypeOfTimespan;
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;
- break;
- default:
- base.SetSchemaType(schemaRow, metaData, columnIndex);
- break;
- }
- }
-
- public override decimal GetDecimal(int i) {
- if (IsNumeric(i))
- return GetDecimalSafe(i);
-
- return base.GetDecimal(i);
- }
-
- public override double GetDouble(int i) {
- if (IsNumeric(i))
- return GetDoubleSafe(i);
-
- return base.GetDouble(i);
- }
-
- public override float GetFloat(int i) {
- if (IsNumeric(i))
- return GetFloatSafe(i);
-
- return base.GetFloat(i);
- }
-//
-// OracleClient does not "excuse" for Int16
-//
-// public override short GetInt16(int i) {
-// if (IsNumeric(i))
-// return GetInt16Safe(i);
-//
-// return base.GetInt16(i);
-// }
-
-
- public override int GetInt32(int i) {
- if (IsNumeric(i))
- return GetInt32Safe(i);
-
- return base.GetInt32(i);
- }
-
- public override long GetInt64(int i) {
- if (IsNumeric(i))
- return GetInt64Safe(i);
-
- return base.GetInt64(i);
- }
-
-#if SUPPORT_ORACLE_TYPES
- #region GetOracleXXX
-
- public OracleBFile GetOracleBFile(
- int i
- ) {
- throw new NotImplementedException();
- }
-
- public OracleBinary GetOracleBinary(
- int i
- ) {
- throw new NotImplementedException();
- }
-
- public OracleDateTime GetOracleDateTime(
- int i
- ) {
- throw new NotImplementedException();
- }
-
- public OracleLob GetOracleLob(
- int i
- ) {
- throw new NotImplementedException();
- }
-
- public OracleMonthSpan GetOracleMonthSpan(
- int i
- ) {
- throw new NotImplementedException();
- }
-
- public OracleNumber GetOracleNumber(
- int i
- ) {
- throw new NotImplementedException();
- }
-
- public OracleString GetOracleString(
- int i
- ) {
- throw new NotImplementedException();
- }
-
- public OracleTimeSpan GetOracleTimeSpan(
- int i
- ) {
- throw new NotImplementedException();
- }
-
- public object GetOracleValue(
- int i
- ) {
- throw new NotImplementedException();
- }
-
- public int GetOracleValues(
- object[] values
- ) {
- throw new NotImplementedException();
- }
-
- #endregion
-#endif
-
- #endregion // Methods
- }
-}
\ No newline at end of file diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleError.cs b/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleError.cs deleted file mode 100644 index fbdb138062c..00000000000 --- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleError.cs +++ /dev/null @@ -1,67 +0,0 @@ -//
-// System.Data.OleDb.OleDbError
-// -// Authors: -// Konstantin Triger <kostat@mainsoft.com> -// -// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -//
-
-
-namespace System.Data.OracleClient {
- using java.sql;
- using System.Data.Common;
- using System.Data.ProviderBase;
-
- [Serializable]
- internal sealed class OracleError : AbstractDbError {
-
- internal OracleError(SQLException e, AbstractDBConnection connection) : base(e, connection) {
- }
-
- public String Message {
- get {
- return DbMessage;
- }
- }
-
- public int NativeError {
- get {
- return DbErrorCode;
- }
- }
-
- public String Source {
- get {
- return DbSource;
- }
- }
-
- public String SQLState {
- get {
- return DbSQLState;
- }
- }
- }
-}
\ No newline at end of file diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleErrorCollection.cs b/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleErrorCollection.cs deleted file mode 100644 index 8ff780aa160..00000000000 --- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleErrorCollection.cs +++ /dev/null @@ -1,61 +0,0 @@ -//
-// System.Data.OleDb.OleDbErrorCollection
-// -// Authors: -// Konstantin Triger <kostat@mainsoft.com> -// -// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -//
-
-
-namespace System.Data.OracleClient {
-
-
- using System.Collections;
- using java.sql;
- using System.Data.Common;
- using System.Data.ProviderBase;
-
- [Serializable]
- public sealed class OracleErrorCollection : AbstractDbErrorCollection {
- internal OracleErrorCollection(SQLException e, AbstractDBConnection connection) : base(e, connection) {
- }
- /**
- * Gets the error at the specified index.
- *
- * @param index of the error
- * @return Error on specified index
- */
- internal OracleError this[int index] {
- get {
- return (OracleError)GetDbItem(index);
- }
- }
-
- protected override AbstractDbError CreateDbError(SQLException e, AbstractDBConnection connection) {
- return new OracleError(e, connection);
- }
-
- }
-}
\ No newline at end of file diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleException.cs b/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleException.cs deleted file mode 100644 index 155f986d2b7..00000000000 --- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleException.cs +++ /dev/null @@ -1,153 +0,0 @@ -//
-// System.Data.SqlClient.SqlException
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Data.OracleClient {
-
- using java.sql;
-
- using System;
- using System.Data.ProviderBase;
-
- /**
- * The exception that is thrown when SQL Server returns a warning or error.
- * This class cannot be inherited.
- */
-
- /*
- * CURRENT LIMITATIONS
- * 1. Constructor for serialization SqlException(SerializationInfo info, StreamingContext sc)
- * is not supported.
- * 2. Method "void GetObjectData(...,...)" is not supported (serialization)
- */
-
- public sealed class OracleException : AbstractDbException {
- internal OracleException(Exception cause, OracleConnection connection) : base(cause, connection) {}
-
- internal OracleException(SQLException cause, OracleConnection connection) : base(cause, connection) {}
-
- internal OracleException(string message, SQLException cause, OracleConnection connection) : base(message, cause, connection) {}
-
- protected override AbstractDbErrorCollection DbErrors {
- get {
- return Errors;
- }
- }
-
-
-
- /**
- * Gets the severity level of the error returned from the SQL Server .NET
- * Data Provider.
- * @return severity level of the first error in the collection.
- */
-// public byte Class {
-// get {
-// SqlErrorCollection errors = Errors;
-// return errors.Count > 0 ? errors[0].Class : (byte)0;
-// }
-// }
-
- /**
- * Gets a collection of one or more SqlError objects that give detailed
- * information about exceptions generated by the SQL Server .NET Data Provider.
- * @return collection of SqlError objects
- */
- internal OracleErrorCollection Errors {
- get {
- return new OracleErrorCollection(_cause, _connection);
- }
- }
-
- public int Code {
- get { return DbErrorCode; }
- }
-
- /**
- * Gets the line number within the Transact-SQL command batch or stored
- * procedure that generated the error.
- * @return line number of the first error in the collection.
- */
-// public int LineNumber {
-// get {
-// SqlErrorCollection errors = Errors;
-// return errors.Count > 0 ? errors[0].LineNumber : 0;
-// }
-// }
-
- /**
- * Gets a number that identifies the type of error.
- * @return number that identifies the type of first error in the collection
- */
-// public int Number {
-// get {
-// SqlErrorCollection errors = Errors;
-// return errors.Count > 0 ? errors[0].Number : 0;
-// }
-// }
-
- /**
- * Gets the name of the stored procedure or remote procedure call (RPC)
- * that generated the error.
- * @return name of the stored procedure
- */
-// public String Procedure {
-// get {
-// SqlErrorCollection errors = Errors;
-// return errors.Count > 0 ? errors[0].Procedure : null;
-// }
-// }
-
- /**
- * Gets the name of the computer running an instance of SQL Server
- * that generated the error.
- * @return name of the computer where error generated
- */
-// public String Server {
-// get {
-// SqlErrorCollection errors = Errors;
-// return errors.Count > 0 ? errors[0].Server : null;
-// }
-// }
-
-
- /**
- * Gets a numeric error code from SQL Server that represents an error,
- * warning or "no data found" message.
- * @return numeric error code from SQL Server
- */
-// public byte State {
-// get {
-// SqlErrorCollection errors = Errors;
-// return errors.Count > 0 ? errors[0].State : (byte)0;
-// }
-// }
- }
-}
\ No newline at end of file diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleParameter.cs b/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleParameter.cs deleted file mode 100644 index d6b4e11e7e0..00000000000 --- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleParameter.cs +++ /dev/null @@ -1,230 +0,0 @@ -//
-// System.Data.OracleClient.OracleParameter
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Text;
-using System.Data;
-using System.Data.Common;
-using System.Data.ProviderBase;
-using System.Globalization;
-
-using java.sql;
-using java.lang;
-
-namespace System.Data.OracleClient {
- public sealed class OracleParameter : AbstractDbParameter, ICloneable {
-
- #region Fields
-
- OracleType _oleDbType = OracleType.VarChar;
-
- #endregion // Fields
-
- #region Constructors
-
- public OracleParameter() {
- }
-
- public OracleParameter(String parameterName, Object value)
- : this (parameterName, OracleType.VarChar, 0, ParameterDirection.Input,
- false, 0, 0, String.Empty, DataRowVersion.Current, value) {
- IsDbTypeSet = false;
- }
-
- public OracleParameter(String parameterName, OracleType dbType)
- : this (parameterName, dbType, 0, ParameterDirection.Input,
- false, 0, 0, String.Empty, DataRowVersion.Current, null) {
- }
-
- public OracleParameter(String parameterName, OracleType dbType, int size)
- : this (parameterName, dbType, size, ParameterDirection.Input,
- false, 0, 0, String.Empty, DataRowVersion.Current, null) {
- }
-
- public OracleParameter(String parameterName, OracleType dbType, int size,
- String sourceColumn)
- : this (parameterName, dbType, size, ParameterDirection.Input,
- false, 0, 0, sourceColumn, DataRowVersion.Current, null) {
- }
-
-
- public OracleParameter(String parameterName,
- OracleType dbType,
- int size,
- ParameterDirection direction,
- bool isNullable,
- byte precision,
- byte scale,
- String sourceColumn,
- DataRowVersion sourceVersion,
- Object value) {
- ParameterName = parameterName;
- OracleType = dbType;
- Size = size;
- Direction = direction;
- IsNullable = isNullable;
- Precision = precision;
- Scale = scale;
- SourceColumn = sourceColumn;
- SourceVersion = sourceVersion;
- Value = value;
- }
-
- #endregion // Constructors
-
- #region Properties
-
- public override DbType DbType {
- get { return OracleConvert.OracleTypeToDbType(_oleDbType); }
- set { OracleType = OracleConvert.DbTypeToOracleType(value); }
- }
-
- public OracleType OracleType {
- get { return _oleDbType; }
- set {
- _oleDbType = value;
- IsDbTypeSet = true;
- }
- }
-
- public new Object Value {
- get { return base.Value; }
- set {
- if (!IsDbTypeSet && (value != null) && (value != DBNull.Value)) {
- _oleDbType = OracleConvert.ValueTypeToOracleType(value.GetType());
- }
- base.Value = value;
- }
- }
-
-#if NET_2_0
- public new byte Precision {
- get { return base.Precision; }
- set { base.Precision = value; }
- }
-
- public new byte Scale {
- get { return base.Scale; }
- set { base.Scale = value; }
- }
-#endif
-
- #endregion // Properties
-
- #region Methods
-
- public override String ToString() {
- return ParameterName;
- }
-
- protected override string Placeholder {
- get {
- if (ParameterName.Length == 0 || ParameterName[0] == ':')
- return ParameterName;
-
- return String.Concat(":", ParameterName);
- }
- }
-
- internal string InternalPlaceholder {
- get {
- return Placeholder;
- }
- }
-
- protected sealed override object ConvertValue(object value) {
- // can not convert null or DbNull to other types
- if (value == null || value == DBNull.Value) {
- return value;
- }
-
- // TBD : some other way to do this?
-// if (OracleType == OracleType.Binary) {
-// return value;
-// }
- // .NET throws an exception to the user.
- object convertedValue = value;
-
- // note : if we set user parameter jdbc type inside prepare interbal, the db type is not set
- if (value is IConvertible && (IsDbTypeSet || IsJdbcTypeSet)) {
- OracleType oleDbType = (IsDbTypeSet) ? OracleType : OracleConvert.JdbcTypeToOracleType((int)JdbcType);
- Type to = OracleConvert.OracleTypeToValueType(oleDbType);
- if (!(value is DateTime && to == OracleConvert.TypeOfTimespan)) //anyway will go by jdbc type
- convertedValue = Convert.ChangeType(value,to);
- }
- return convertedValue;
- }
-
- protected sealed override void SetParameterName(ResultSet res) {
- ParameterName = res.getString("COLUMN_NAME");
- }
-
- protected sealed override void SetParameterDbType(ResultSet res) {
- int jdbcType = res.getInt("DATA_TYPE");
- // FIXME : is that correct?
- if (jdbcType == Types.OTHER) {
- string typeName = res.getString("TYPE_NAME");
- if (String.Compare("REF CURSOR", typeName, true, CultureInfo.InvariantCulture) == 0) {
- jdbcType = (int)JavaSqlTypes.CURSOR;
- }
- else if (String.Compare("BLOB",typeName,true, CultureInfo.InvariantCulture) == 0) {
- jdbcType = (int)JavaSqlTypes.BLOB;
- }
- else if (String.Compare("CLOB",typeName,true, CultureInfo.InvariantCulture) == 0) {
- jdbcType = (int)JavaSqlTypes.CLOB;
- }
- else if(String.Compare("FLOAT",typeName,true, CultureInfo.InvariantCulture) == 0) {
- jdbcType = (int)JavaSqlTypes.FLOAT;
- }
- else if(String.Compare("NVARCHAR2",typeName,true, CultureInfo.InvariantCulture) == 0) {
- jdbcType = (int)JavaSqlTypes.VARCHAR;
- }
- else if(String.Compare("NCHAR",typeName,true, CultureInfo.InvariantCulture) == 0) {
- jdbcType = (int)JavaSqlTypes.VARCHAR;
- }
- }
- OracleType = OracleConvert.JdbcTypeToOracleType(jdbcType);
- JdbcType = jdbcType;
- }
-
- protected sealed override void SetSpecialFeatures(ResultSet res) {
- // do nothing
- }
-
- protected sealed override int JdbcTypeFromProviderType() {
- return OracleConvert.OracleTypeToJdbcType(OracleType);
- }
-
- #endregion // Methods
-
- }
-}
\ No newline at end of file |