根据错误描述,您正在向数据库中插入错误的类型。请参阅JDBC到MSSQL。您应该将Calendar转换为Timestamp。
尝试使用:
PrepareStatement statement
= connection.prepareStatement("INSERT INTO Companies CreatedOn VALUES(?)");
java.sql.Timestamp timestamp = new java.sql.Timestamp(cal.getTimeInMillis());
statement.setTimestamp(1, timstamp);
int insertedRecordsCount = statement.executeUpdate();