summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormianrui2012-10-15 03:04:17 (EDT)
committermwu2012-10-15 03:04:17 (EDT)
commitb95c016d36cb92d0223b44b46817505db2099af9 (patch)
tree3ee28970682e700dec36ef293aed6dc73ca5ee81
parent28c7bdacd1ab4ba736e43abe3e093218b41b36bb (diff)
downloadorg.eclipse.datatools.enablement.oda-b95c016d36cb92d0223b44b46817505db2099af9.zip
org.eclipse.datatools.enablement.oda-b95c016d36cb92d0223b44b46817505db2099af9.tar.gz
org.eclipse.datatools.enablement.oda-b95c016d36cb92d0223b44b46817505db2099af9.tar.bz2
Error message should pop up before preview when change dataset column tov201210151504
invalid data type.(T51414)
-rw-r--r--plugins/org.eclipse.datatools.connectivity.oda.flatfile/src/org/eclipse/datatools/connectivity/oda/flatfile/ResultSet.java21
1 files changed, 16 insertions, 5 deletions
diff --git a/plugins/org.eclipse.datatools.connectivity.oda.flatfile/src/org/eclipse/datatools/connectivity/oda/flatfile/ResultSet.java b/plugins/org.eclipse.datatools.connectivity.oda.flatfile/src/org/eclipse/datatools/connectivity/oda/flatfile/ResultSet.java
index 9915aa3..1873a76 100644
--- a/plugins/org.eclipse.datatools.connectivity.oda.flatfile/src/org/eclipse/datatools/connectivity/oda/flatfile/ResultSet.java
+++ b/plugins/org.eclipse.datatools.connectivity.oda.flatfile/src/org/eclipse/datatools/connectivity/oda/flatfile/ResultSet.java
@@ -366,8 +366,10 @@ public class ResultSet implements IResultSet
* Transform a String value to an int value
* @param stringValue String value
* @return Corresponding int value
+ * @throws ParseException
+ * @throws OdaException
*/
- private int stringToInt( String stringValue )
+ private int stringToInt( String stringValue ) throws OdaException
{
if( stringValue != null )
{
@@ -387,6 +389,7 @@ public class ResultSet implements IResultSet
}
catch ( ParseException e1 )
{
+ throw new OdaException( "Can not convert "+"\""+stringValue+"\""+" to Integer" );
}
}
}
@@ -398,8 +401,9 @@ public class ResultSet implements IResultSet
* Transform a String value to a double value
* @param stringValue String value
* @return Corresponding double value
+ * @throws OdaException
*/
- private double stringToDouble( String stringValue )
+ private double stringToDouble( String stringValue ) throws OdaException
{
if( stringValue != null )
{
@@ -419,6 +423,7 @@ public class ResultSet implements IResultSet
}
catch ( ParseException e1 )
{
+ throw new OdaException( "Can not convert "+"\""+stringValue+"\""+" to a double value" );
}
}
}
@@ -430,8 +435,9 @@ public class ResultSet implements IResultSet
* Transform a String value to a big decimal value
* @param stringValue String value
* @return Corresponding BigDecimal value
+ * @throws OdaException
*/
- private BigDecimal stringToBigDecimal( String stringValue )
+ private BigDecimal stringToBigDecimal( String stringValue ) throws OdaException
{
if( stringValue != null )
{
@@ -451,6 +457,7 @@ public class ResultSet implements IResultSet
}
catch ( ParseException e1 )
{
+ throw new OdaException( "Can not convert "+"\""+stringValue+"\""+" to a BigDecimal value" );
}
}
}
@@ -475,6 +482,7 @@ public class ResultSet implements IResultSet
}
catch ( OdaException oe )
{
+ throw new OdaException( "Can not convert "+"\""+stringValue+"\""+" to a date value" );
}
}
@@ -498,6 +506,7 @@ public class ResultSet implements IResultSet
}
catch ( OdaException oe )
{
+ throw new OdaException( "Can not convert "+"\""+stringValue+"\""+" to a Time value" );
}
}
this.wasNull = true;
@@ -537,7 +546,7 @@ public class ResultSet implements IResultSet
}
catch ( OdaException ex )
{
- //ignore
+ throw new OdaException( "Can not convert string "+"\""+stringValue+"\""+" to a Timestamp value" );
}
}
}
@@ -550,8 +559,9 @@ public class ResultSet implements IResultSet
* Transform a string to boolean value
* @param stringValue
* @return
+ * @throws OdaException
*/
- private Boolean stringToBoolean( String stringValue )
+ private Boolean stringToBoolean( String stringValue ) throws OdaException
{
if ( stringValue != null )
{
@@ -580,6 +590,7 @@ public class ResultSet implements IResultSet
}
catch ( ParseException e1 )
{
+ throw new OdaException( "Can not convert "+"\""+stringValue+"\""+" to boolean value" );
}
}
}