From the doc (https://www.sqlite.org/datatype3.html), sqlite datatype system seems to be very different
from other databases.
A date may be stored as a String, a Integer or a Double, even if it is declared as a date.

If it is stored as a String, I think that getTimestamp will not recognize the format, hence the error.
You may have to use
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.sss")
then
sdf.parse(string) -> Date
or the FlexibleDateParser of OpenJUMP which will recognize more formats

Michaël

Le 22/04/2015 23:46, Rahkonen Jukka (MML) a écrit :
Hi,

The SQLite/Spatialite/GeoPackage driver of the DB Query Plugin is reading data 
from a column that is recognized as a DATE with this code that comes from 
http://sourceforge.net/p/jumpdbqplugin/code/ci/default/tree/src/main/java/org/freevoice/jumpdbqueryextension/spatialite/JumpSpatialiteDbQuery.java
 (line 252)

  else if (AttributeType.DATE.equals(attributeType))
       {
          returnObject = new 
Date(results.getTimestamp(dbColumnIndex).getTime());
       }

I found that the code gives an error if dates in the database are encoded into ISO text 
format, like "2015-04-23".  After some experiments I started to think that 
results.getTimestamp(dbColumnIndex).getTime() awaits a number, perhaps an integer number, 
maybe UNIX seconds.

It would be better to consider that all times in those databases (DATE, TIME, 
TIMESTAMP, DATETIME) are ISO strings. If date is not a valid ISO data string 
they it could be skipped and converted into NULL for OpenJUMP. That would be 
more user friendly than to stop parsing and quit.

More details about times in SQLite based databases in gdal-dev thread 
http://thread.gmane.org/gmane.comp.gis.gdal.devel/40172

-Jukka Rahkonen-




------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel


------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to