From: Boris Kirzner Date: Wed, 16 Nov 2005 10:18:00 +0000 (-0000) Subject: TARGET_JVM fix. Throw exception if MSSQL port resolution failed. X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;ds=sidebyside;h=9f2538faff65c8d14b1da3352006dc152c404e3c;p=mono.git TARGET_JVM fix. Throw exception if MSSQL port resolution failed. svn path=/trunk/mcs/; revision=53102 --- diff --git a/mcs/class/System.Data/System.Data.OleDb.jvm/ChangeLog b/mcs/class/System.Data/System.Data.OleDb.jvm/ChangeLog index 94a6f2851b7..89190aca42b 100644 --- a/mcs/class/System.Data/System.Data.OleDb.jvm/ChangeLog +++ b/mcs/class/System.Data/System.Data.OleDb.jvm/ChangeLog @@ -1,3 +1,6 @@ +2005-16-11 Boris Kirzner + * OleDbConnection.cs: Added override for CreateException(). + 2005-11-07 Konstantin Triger * OleDbConnection.cs: retrieve the StringManager from AppDomain diff --git a/mcs/class/System.Data/System.Data.OleDb.jvm/OleDbConnection.cs b/mcs/class/System.Data/System.Data.OleDb.jvm/OleDbConnection.cs index a2b1d510062..36242a23350 100644 --- a/mcs/class/System.Data/System.Data.OleDb.jvm/OleDbConnection.cs +++ b/mcs/class/System.Data/System.Data.OleDb.jvm/OleDbConnection.cs @@ -247,6 +247,11 @@ namespace System.Data.OleDb return new OleDbException(e,this); } + protected override SystemException CreateException(string message) + { + return new OleDbException(message, null, this); + } + public DataTable GetOleDbSchemaTable (Guid schema, object[] restrictions) { DataTable schemaTable = new DataTable("Tables"); diff --git a/mcs/class/System.Data/System.Data.ProviderBase.jvm/AbstractDBConnection.cs b/mcs/class/System.Data/System.Data.ProviderBase.jvm/AbstractDBConnection.cs index e63dade601d..4fd7a7914ef 100644 --- a/mcs/class/System.Data/System.Data.ProviderBase.jvm/AbstractDBConnection.cs +++ b/mcs/class/System.Data/System.Data.ProviderBase.jvm/AbstractDBConnection.cs @@ -574,7 +574,9 @@ namespace System.Data.Common } // todo : what should we do if all the timeout spent on port resolution ? if ("-1".Equals(port)) { - port = StringManager.GetString("SQL_CON_PORT", "1433"); //default port of MSSql Server 3167. + string message = String.Format ("Unable to retrieve the port number for {0} using UDP on port 1434. Please see your network administrator to solve this problem or add the port number of your SQL server instance to your connection string (i.e. port=1681).",ServerName); + Exception e = CreateException (message); + throw e; } ConnectionStringHelper.AddValue(UserParameters,StringManager.GetStringArray("CON_PORT"),port); break; @@ -705,6 +707,8 @@ namespace System.Data.Common protected abstract SystemException CreateException(SQLException e); + protected abstract SystemException CreateException(string message); + public override void Close() { try { diff --git a/mcs/class/System.Data/System.Data.ProviderBase.jvm/ChangeLog b/mcs/class/System.Data/System.Data.ProviderBase.jvm/ChangeLog index 686f219afb7..d0570f85b40 100644 --- a/mcs/class/System.Data/System.Data.ProviderBase.jvm/ChangeLog +++ b/mcs/class/System.Data/System.Data.ProviderBase.jvm/ChangeLog @@ -1,3 +1,7 @@ +2005-16-11 Boris Kirzner + * AbstractDBConnection.cs: TARGET_JVM fix. Throw exception if MSSQL port + resolution failed. + 2005-14-11 Boris Kirzner * AbstractDBCommand.cs: TARGET_JVM fix. Provider name can be in any case.. diff --git a/mcs/class/System.Data/System.Data.SqlClient.jvm/ChangeLog b/mcs/class/System.Data/System.Data.SqlClient.jvm/ChangeLog index 623991322a6..dcde2a0cef8 100644 --- a/mcs/class/System.Data/System.Data.SqlClient.jvm/ChangeLog +++ b/mcs/class/System.Data/System.Data.SqlClient.jvm/ChangeLog @@ -1,3 +1,6 @@ +2005-16-11 Boris Kirzner + * SqlConnection.cs: Added override for CreateException(). + 2005-09-14 Boris Kirzner * SqlConvert.cs: Fix SqlDbType to JDBC type convertion. diff --git a/mcs/class/System.Data/System.Data.SqlClient.jvm/SqlConnection.cs b/mcs/class/System.Data/System.Data.SqlClient.jvm/SqlConnection.cs index d754f0f5584..b4474830f8f 100644 --- a/mcs/class/System.Data/System.Data.SqlClient.jvm/SqlConnection.cs +++ b/mcs/class/System.Data/System.Data.SqlClient.jvm/SqlConnection.cs @@ -212,6 +212,11 @@ namespace System.Data.SqlClient return new SqlException(e, this); } + protected override SystemException CreateException(string message) + { + return new SqlException(message, null, this); + } + private void OnSqlInfoMessage (SqlInfoMessageEventArgs value) { if (InfoMessage != null) {