Customize date format in hsqldb

Hi,
Im currently using psql but for the purpose of unit testing Im using HSQLDB to run my queries. All the queries works fine in psql but I get invalid datetime format exception in hsql.
Below is my query,
INSERT INTO microbatch_redrive
SELECT mii.*,(to_char(CURRENT_TIMESTAMP ,'yyyy-mm-ddThh:mi:ss.msZ')) FROM
(SELECT * FROM
  ( SELECT mi.*,me.extractid FROM
    (SELECT * FROM microbatch_info WHERE
        ((numattempts<= ${maxNumOfAttempts})
        AND (starttime>= '${starttime}') 
        AND (starttime<= '${endtime}')))
    AS mi LEFT OUTER JOIN microbatch_extract_info AS me ON mi.microbatchid = me.microbatchid) 
    AS mime WHERE((mime.raverunstatus='SUCCEEDED' AND mime.extractid is null)
    OR (mime.starttime < to_char(CURRENT_TIMESTAMP,'yyyy-mm-ddThh:mi:ss.msZ') AND mime.raverunstatus='NOT_STARTED')
    OR (mime.raverunstatus = 'FAILED')
    OR (mime.raverunstatus='STARTED' AND mime.starttime< (to_char(CURRENT_TIMESTAMP - INTERVAL '1' hour * ${extractTimeIntervalInHour},'yyyy-mm-ddThh:mi:ss.msZ')))
    )
) AS mii LEFT OUTER JOIN
(SELECT microbatchid FROM microbatch_redrive WHERE raverunstatus='REDRIVE_SUCCEEDED') AS mr ON mii.microbatchid=mr.microbatchid WHERE mr.microbatchid IS NULL;

Open in new window


ERROR:
 Testcase: getFailedMicrobatchesToRedrive(com.amazon.eradar.scheduledjobs.utils.RedriveFailedMicrobatchUtilTest):    Caused an ERROR
    [junit] data exception: invalid datetime format: Thh:mi:ss.msZ
    [junit] java.sql.SQLDataException: data exception: invalid datetime format: Thh:mi:ss.msZ
    [junit]     at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
    [junit]     at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
    [junit]     at org.hsqldb.jdbc.JDBCStatement.fetchResult(Unknown Source)
    [junit]     at org.hsqldb.jdbc.JDBCStatement.execute(Unknown Source)
    [junit]     at com.amazon.eradar.common.util.RedshiftQueryExecutionUtil.executeOneWay(RedshiftQueryExecutionUtil.java:36)
    [junit]     at com.amazon.eradar.scheduledjobs.utils.RedriveFailedMicrobatchUtil.loadFailedMicrobatches(RedriveFailedMicrobatchUtil.java:52)
    [junit]     at com.amazon.eradar.scheduledjobs.utils.RedriveFailedMicrobatchUtil.getFailedMicrobatchesToRedrive(RedriveFailedMicrobatchUtil.java:36)
    [junit]     at com.amazon.eradar.scheduledjobs.utils.RedriveFailedMicrobatchUtilTest.getFailedMicrobatchesToRedrive(RedriveFailedMicrobatchUtilTest.java:161)


NOTE:-
I want the date to be in the format of  yyyy-mm-ddThh-mi-ss-msZ (Ex.,"2018-04-05T00:00:00.000Z")


Thanks in advance
Ghost FreakAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PostgreSQL

From novice to tech pro — start learning today.