Error importing SDF with date field

User f3c674d443

06-04-2009 14:43:16

I'm doing some tests with JChem 5.2.0 and I'm getting the following error while importing an SD file containing a DATE field:


Error in molecule 1


java.sql.SQLException: 30-01-2008 can not be converted to timestamp
at chemaxon.jchem.db.sql.TypeConverter.convert(TypeConverter.java:119)
at chemaxon.jchem.db.FieldInfo.setValue(FieldInfo.java:219)
at chemaxon.jchem.db.ParallelStructTableUpdater.setValues(ParallelStructTableUpdater.java:179)
at chemaxon.jchem.db.ParallelStructTableUpdater.importFile(ParallelStructTableUpdater.java:381)
at chemaxon.jchem.db.FileToSQLHandler.importFile(FileToSQLHandler.java:129)
at chemaxon.jchem.gui.Importer.run(Importer.java:138)
at java.lang.Thread.run(Unknown Source)
chemaxon.util.ChemaxonException: chemaxon.jchem.db.TransferException: 30-01-2008 can not be converted to timestamp


Caused by:
30-01-2008 can not be converted to timestamp
at chemaxon.jchem.db.ParallelStructTableUpdater.importFile(ParallelStructTableUpdater.java:465)
at chemaxon.jchem.db.FileToSQLHandler.importFile(FileToSQLHandler.java:129)
at chemaxon.jchem.gui.Importer.run(Importer.java:138)
at java.lang.Thread.run(Unknown Source)
Caused by: chemaxon.jchem.db.TransferException: 30-01-2008 can not be converted to timestamp
at chemaxon.jchem.db.ParallelStructTableUpdater.importFile(ParallelStructTableUpdater.java:455)
... 3 more


 



OS is Wimdows 2003, Database is "Oracle Database 10g Release 10.2.0.4.0". The Table was generated with jcman an the date column is of type "DATE".  Java version is "1.6.0_12"


Tried some other date formats (e.g. 30-JAN-2008) to no avail.


Thanks


 

ChemAxon 9c0afc9aaf

07-04-2009 14:58:47

Hi,


 


Proper handling of date types and string to date conversion has not been implemneted in JChem Base yet.


Surprisingly nobody asked for this before.


 


Instant JChem can already handle this, we will try to port the solution to JChem Base as soon as possible and get back to you.


 


Best regards,


Szilard

User f3c674d443

08-04-2009 09:13:42

Thanks for the assistance.


The problem arose because of the MOL_DATE field in our ISIS database. I could easily import the dates as text and then copy in the DATE column with SQL. Should be done only once.


Regards.