Skip to content
Advertisement

Is it possible to access application properties from schema.sql?

I want to make a date type variable.
Locally I am using a h2-database. But I am deploying into a cloud with a Hana DB.
Hana has the exact Date format I am needing: SECONDDATE (YYYY-MM-DD HH24:MI:SS). Suddenly it is not an widely used format. And h2 does not support it and runs into error by initialization of the DB. Though I am using different formats, the behavior of them would exactly that I need.

Is it possible to let my H2 use the TIMESTAMP format, when the HANA instance will use the SECONDDATE?

Advertisement

Answer

Both data types, HANA’s seconddate and H2’s timestamp with precision 0 and no timezone can/will be mapped to java.sql.Timestamp by the respective JDBC drivers.

From that point of view, there’s nothing stopping you from using those two different data types in the different databases to store the same application information.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement