summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormianrui2012-10-19 03:40:05 (EDT)
committermwu2012-10-19 03:40:05 (EDT)
commit5770cf9d0523b7b17913ff18daaf9ab173180dbd (patch)
treeb3f8c34ec94db918b69a5cea8a5382ec2b8cfce4
parent058ed661f5a980e99ecbb4086136599788f9b73c (diff)
downloadorg.eclipse.datatools.enablement.oda-5770cf9d0523b7b17913ff18daaf9ab173180dbd.zip
org.eclipse.datatools.enablement.oda-5770cf9d0523b7b17913ff18daaf9ab173180dbd.tar.gz
org.eclipse.datatools.enablement.oda-5770cf9d0523b7b17913ff18daaf9ab173180dbd.tar.bz2
XML ODA driver fails to recognize UTC date/time value with Z asv201210191540
timezone(T53937)
-rw-r--r--plugins/org.eclipse.datatools.enablement.oda.xml/src/org/eclipse/datatools/enablement/oda/xml/impl/ResultSet.java3
-rw-r--r--plugins/org.eclipse.datatools.enablement.oda.xml/src/org/eclipse/datatools/enablement/oda/xml/util/date/DateFormatISO8601.java2
2 files changed, 4 insertions, 1 deletions
diff --git a/plugins/org.eclipse.datatools.enablement.oda.xml/src/org/eclipse/datatools/enablement/oda/xml/impl/ResultSet.java b/plugins/org.eclipse.datatools.enablement.oda.xml/src/org/eclipse/datatools/enablement/oda/xml/impl/ResultSet.java
index fe36991..dc1e1a7 100644
--- a/plugins/org.eclipse.datatools.enablement.oda.xml/src/org/eclipse/datatools/enablement/oda/xml/impl/ResultSet.java
+++ b/plugins/org.eclipse.datatools.enablement.oda.xml/src/org/eclipse/datatools/enablement/oda/xml/impl/ResultSet.java
@@ -482,7 +482,10 @@ public class ResultSet implements IResultSet
{
try
{
+ if ( !stringValue.endsWith( "Z" ))
+ {
stringValue = stringValue.replaceAll("\\QT\\E", SINGLE_SPACE).split("\\QZ\\E")[0];//$NON-NLS-1$ //$NON-NLS-2$
+ }
return Timestamp.valueOf( stringValue );
}
catch( IllegalArgumentException e )
diff --git a/plugins/org.eclipse.datatools.enablement.oda.xml/src/org/eclipse/datatools/enablement/oda/xml/util/date/DateFormatISO8601.java b/plugins/org.eclipse.datatools.enablement.oda.xml/src/org/eclipse/datatools/enablement/oda/xml/util/date/DateFormatISO8601.java
index d116467..88697a9 100644
--- a/plugins/org.eclipse.datatools.enablement.oda.xml/src/org/eclipse/datatools/enablement/oda/xml/util/date/DateFormatISO8601.java
+++ b/plugins/org.eclipse.datatools.enablement.oda.xml/src/org/eclipse/datatools/enablement/oda/xml/util/date/DateFormatISO8601.java
@@ -80,7 +80,7 @@ public class DateFormatISO8601
int zoneIndex = s.indexOf( 'Z' );
if ( zoneIndex >= 0 && zoneIndex == s.length( ) - 1 )
{
- return s.substring( 0, zoneIndex ).trim( );
+ return s.replace( "Z", "+00:00" ).trim( );
}
return s;
}