summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpshi2011-10-26 01:12:29 (EDT)
committer mwu2011-10-26 01:12:29 (EDT)
commit5696eddc8e83d84b7b9f801071091ee9a3eb39bd (patch)
tree4f8d4fc60b0628c895f28c1394f98f6c04058bd2
parentf05c077130b1dd44cb88983416295125546bb832 (diff)
downloadorg.eclipse.birt-5696eddc8e83d84b7b9f801071091ee9a3eb39bd.zip
org.eclipse.birt-5696eddc8e83d84b7b9f801071091ee9a3eb39bd.tar.gz
org.eclipse.birt-5696eddc8e83d84b7b9f801071091ee9a3eb39bd.tar.bz2
fix ted bug 42700, throw the runtimeException when test connection.
-rw-r--r--data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/profile/JDBCSelectionPageHelper.java2
-rw-r--r--data/org.eclipse.birt.report.data.oda.jdbc/src/org/eclipse/birt/report/data/oda/i18n/Messages.properties1
-rw-r--r--data/org.eclipse.birt.report.data.oda.jdbc/src/org/eclipse/birt/report/data/oda/i18n/ResourceConstants.java1
-rw-r--r--data/org.eclipse.birt.report.data.oda.jdbc/src/org/eclipse/birt/report/data/oda/jdbc/JDBCDriverManager.java8
4 files changed, 10 insertions, 2 deletions
diff --git a/data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/profile/JDBCSelectionPageHelper.java b/data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/profile/JDBCSelectionPageHelper.java
index 749a46a..91fb3d8 100644
--- a/data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/profile/JDBCSelectionPageHelper.java
+++ b/data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/profile/JDBCSelectionPageHelper.java
@@ -589,7 +589,7 @@ public class JDBCSelectionPageHelper
{
ExceptionHandler.showException( getShell( ),
JdbcPlugin.getResourceString( "connection.test" ),//$NON-NLS-1$
- JdbcPlugin.getResourceString( e1.getLocalizedMessage( ) ),
+ e1.getLocalizedMessage( ),
e1 );
}
testButton.setEnabled( true );
diff --git a/data/org.eclipse.birt.report.data.oda.jdbc/src/org/eclipse/birt/report/data/oda/i18n/Messages.properties b/data/org.eclipse.birt.report.data.oda.jdbc/src/org/eclipse/birt/report/data/oda/i18n/Messages.properties
index a24ab70..6f0b32d 100644
--- a/data/org.eclipse.birt.report.data.oda.jdbc/src/org/eclipse/birt/report/data/oda/i18n/Messages.properties
+++ b/data/org.eclipse.birt.report.data.oda.jdbc/src/org/eclipse/birt/report/data/oda/i18n/Messages.properties
@@ -96,3 +96,4 @@ odajdbc.CannotInstantiateDriverClass=Cannot create instance of JDBC Driver class
odajdbc.CannotInstantiateFactory=Cannot create instance of connection factory class "{0}" defined in the extension for driver class "{1}".
odajdbc.jndi.InvalidJndiResource=Found JNDI resource type ({0}); expecting javax.sql.DataSource type.
+odajdbc.testfail=Test Fail \ No newline at end of file
diff --git a/data/org.eclipse.birt.report.data.oda.jdbc/src/org/eclipse/birt/report/data/oda/i18n/ResourceConstants.java b/data/org.eclipse.birt.report.data.oda.jdbc/src/org/eclipse/birt/report/data/oda/i18n/ResourceConstants.java
index 01d807b..4cb1b96 100644
--- a/data/org.eclipse.birt.report.data.oda.jdbc/src/org/eclipse/birt/report/data/oda/i18n/ResourceConstants.java
+++ b/data/org.eclipse.birt.report.data.oda.jdbc/src/org/eclipse/birt/report/data/oda/i18n/ResourceConstants.java
@@ -137,4 +137,5 @@ public class ResourceConstants
public final static String CANNOT_INSTANTIATE_FACTORY="odajdbc.CannotInstantiateFactory";
public final static String JNDI_INVALID_RESOURCE="odajdbc.jndi.InvalidJndiResource";
+ public final static String TEST_CONNECTION_FAIL="odajdbc.testfail";
} \ No newline at end of file
diff --git a/data/org.eclipse.birt.report.data.oda.jdbc/src/org/eclipse/birt/report/data/oda/jdbc/JDBCDriverManager.java b/data/org.eclipse.birt.report.data.oda.jdbc/src/org/eclipse/birt/report/data/oda/jdbc/JDBCDriverManager.java
index 9b1f711..968fb0b 100644
--- a/data/org.eclipse.birt.report.data.oda.jdbc/src/org/eclipse/birt/report/data/oda/jdbc/JDBCDriverManager.java
+++ b/data/org.eclipse.birt.report.data.oda.jdbc/src/org/eclipse/birt/report/data/oda/jdbc/JDBCDriverManager.java
@@ -668,7 +668,13 @@ public class JDBCDriverManager
}
catch ( SQLException e )
{
- throw new JDBCException( e.getLocalizedMessage( ), null );
+ throw new JDBCException( ResourceConstants.TEST_CONNECTION_FAIL, e );
+ }
+ catch( RuntimeException e )
+ {
+ OdaException ex = new OdaException( e.getLocalizedMessage( ) );
+ ex.initCause( e );
+ throw ex;
}
// If the given url cannot be parsed.
if ( canConnect == false )