I am using H2 DB in my Java application. I want to load a .csv file to a table. My .csv file contains a timestamp in format 07/16/2011 02:43:43 but the default timestamp format of H2 DB is 2005-12-31 23:59:59
so when I am using CSVREAD to load that .csv file to the DB, I am getting the following exception:
org.h2.jdbc.JdbcSQLException: Cannot parse "TIMESTAMP" constant "07/16/2011 02:43:43"; SQL statement:
-- row #2 ('CIRCLE', 'MSISDN', 'PORT_IN_DATE', 'OPERATOR', 'PRODUCT_TYPE', 'PORT_ID') [22007-163]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)
at org.h2.message.DbException.get(DbException.java:158)
at org.h2.value.ValueTimestamp.parse(ValueTimestamp.java:87)
at org.h2.value.Value.convertTo(Value.java:819)
at org.h2.table.Column.convert(Column.java:155)
at org.h2.command.dml.Insert.addRow(Insert.java:153)
at org.h2.command.dml.Select.queryFlat(Select.java:524)
where file.csv has a column labelled DOB
And to insert into your table: