Revision: 6280
http://squirrel-sql.svn.sourceforge.net/squirrel-sql/?rev=6280&view=rev
Author: wis775
Date: 2011-06-01 18:03:44 +0000 (Wed, 01 Jun 2011)
Log Message:
-----------
Bug: 3309565Hard to understand SQL connection error message
The error messages are now defined in resource bundles. So they can be translated.
Modified Paths:
--------------
trunk/sql12/doc/src/main/resources/changes.txt
trunk/sql12/fw/src/main/java/net/sourceforge/squirrel_sql/fw/sql/SQLConnectionState.java
trunk/sql12/fw/src/main/resources/net/sourceforge/squirrel_sql/fw/sql/I18NStrings.properties
Modified: trunk/sql12/doc/src/main/resources/changes.txt
===================================================================
--- trunk/sql12/doc/src/main/resources/changes.txt 2011-05-29 19:58:08 UTC (rev 6279)
+++ trunk/sql12/doc/src/main/resources/changes.txt 2011-06-01 18:03:44 UTC (rev 6280)
@@ -66,6 +66,8 @@
Bug-fixes:
+3309565: Not possible to translate SQL connection error messages, because they are hard coded.
+
3303174: Installer hangs on linux. Updated version of IzPack compiler to 4.3.4.
3137852: DB2 Plugin - The source code is not visible, if a char column contains a default value.
Modified: trunk/sql12/fw/src/main/java/net/sourceforge/squirrel_sql/fw/sql/SQLConnectionState.java
===================================================================
--- trunk/sql12/fw/src/main/java/net/sourceforge/squirrel_sql/fw/sql/SQLConnectionState.java 2011-05-29 19:58:08 UTC (rev 6279)
+++ trunk/sql12/fw/src/main/java/net/sourceforge/squirrel_sql/fw/sql/SQLConnectionState.java 2011-06-01 18:03:44 UTC (rev 6280)
@@ -21,6 +21,8 @@
import net.sourceforge.squirrel_sql.fw.util.IMessageHandler;
import net.sourceforge.squirrel_sql.fw.util.ISessionProperties;
+import net.sourceforge.squirrel_sql.fw.util.StringManager;
+import net.sourceforge.squirrel_sql.fw.util.StringManagerFactory;
import net.sourceforge.squirrel_sql.fw.util.log.ILogger;
import net.sourceforge.squirrel_sql.fw.util.log.LoggerController;
@@ -33,6 +35,9 @@
*/
public class SQLConnectionState
{
+ /** Internationalized strings for this class. */
+ private static final StringManager s_stringMgr = StringManagerFactory.getStringManager(SQLConnectionState.class);
+
private final static ILogger s_log =
LoggerController.createLogger(SQLConnectionState.class);
@@ -60,10 +65,13 @@
}
catch (SQLException ex)
{
- String msg =
- "Error saving transaction isolation.\n" +
- "This might happen when reconnecting a Session to restore a broken connection.\n" +
- "The new connection will use the default transaction isolation.";
+ /*
+ * i18n [SQLConnectionState.errorSavingIsolationState]
+ * Error saving transaction isolation.\n" +
+ * "This might happen when reconnecting a Session to restore a broken connection.\n" +
+ * "The new connection will use the default transaction isolation.";
+ */
+ String msg = s_stringMgr.getString("SQLConnectionState.errorSavingIsolationState");
s_log.error(msg, ex);
if (msgHandler == null)
@@ -79,10 +87,13 @@
}
catch (SQLException ex)
{
- String msg =
+ /*
+ * i18n [SQLConnectionState.errorSavingCatalog]
"Error saving current catalog.\n" +
"This might happen when reconnecting a Session to restore a broken connection.\n" +
"The new connection will use the default catalog.";
+ */
+ String msg = s_stringMgr.getString("SQLConnectionState.errorSavingCatalog");
s_log.error(msg, ex);
if (msgHandler == null)
@@ -102,12 +113,14 @@
}
catch (SQLException ex)
{
- String msg =
+ /*
+ * i18n [SQLConnectionState.errorSavingAutoCommit]
"Error saving autocommit state.\n" +
"This might happen when reconnecting a Session to restore a broken connection.\n" +
"The new connection will use the autocommit state.";
+ */
+ String msg = s_stringMgr.getString("SQLConnectionState.errorSavingAutoCommit");
-
s_log.error(msg, ex);
if (msgHandler == null)
{
Modified: trunk/sql12/fw/src/main/resources/net/sourceforge/squirrel_sql/fw/sql/I18NStrings.properties
===================================================================
--- trunk/sql12/fw/src/main/resources/net/sourceforge/squirrel_sql/fw/sql/I18NStrings.properties 2011-05-29 19:58:08 UTC (rev 6279)
+++ trunk/sql12/fw/src/main/resources/net/sourceforge/squirrel_sql/fw/sql/I18NStrings.properties 2011-06-01 18:03:44 UTC (rev 6280)
@@ -77,3 +77,7 @@
DatabaseObjectType.TRIGGER_TYPE_DBO=Trigger Type
DatabaseObjectType.UDT_TYPE_DBO=UDT Type
DatabaseObjectType.UDF_TYPE_DBO=UDF Type
+
+SQLConnectionState.errorSavingIsolationState=Error saving transaction isolation.\nThis might happen when reconnecting a Session to restore a broken connection.\nThe new connection will use the default transaction isolation.
+SQLConnectionState.errorSavingCatalog=Error saving current catalog.\nThis might happen when reconnecting a Session to restore a broken connection.\nThe new connection will use the default catalog.
+SQLConnectionState.errorSavingAutoCommit=Error saving autocommit state.\nThis might happen when reconnecting a Session to restore a broken connection.\nThe new connection will use the autocommit state.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|