The problem is in the JDBC driver. The same error also happened when inserting values into BigInt columns into MS SQL db’s. Upgrading the JDBC driver to a later version solved the problem.
You also can still use the runPrepUpdate with the old JDBC driver, but you just have to translate the datetime into a string for yourself (something that’s understood by SQL). Or if you can alter the schema, you can use a datetime, which doesn’t give problems with the JDBC.
The other variables don’t need to be escaped as string.
PS. the except java.lang.Exception ...
does work, but if you want to catch everything, an except
without extra arguments also does the trick. The problem is that java.lang.Exception
doesn’t inherit from Exception
in Jython.