← Back to team overview

maria-discuss team mailing list archive

java.sql.Timestamp works in MySQL, fails in MariaDB

 

Recently I changed servers, my old server was running MySQL and my
Java code worked perfectly. My new server is apparently running Ver 15
5.5.44-MariaDB, for Linux (x86 64)

The following code works and has worked perfectly well for the past 4 years

java.sql.Timestamp transactionTimestamp = new
java.sql.Timestamp(System.currentTimeMillis());

PreparedStatement pstmt
...

pstmt.setTimestamp(4, transactionTimestamp);

pstmt.executeUpdate(); // EPIC FAIL, writes all 0s to the database

I'm currently using mysql-connector-java-5.1.22-bin.jar in WEB-INF/lib

Can anyone throw any light on this please?

Many thanks

Lyallex