Snippets code from my daily experience

June 9, 2007

Jdbc Oracle timestamps lose hours/minutes and seconds

Filed under: java, jdbc, oracle — dafi @ 9:30 am

Every Friday about thirdy minutes before I go to home to begin my weekend my collegues make my a very strange question.

This time the question is:

“Hey Davide! Java truncates the timestamps how is this possibile?”

and they continues

“I need this code works before yesterday, please help me to resolve this bug”

Well after some googling I found the motivation, Oracle 10g JDBC driver must be done retrocompatible

Add this line to you application server, Swing application or where you prefer

JAVA_OPTS="$JAVA_OPTS -Doracle.jdbc.V8Compatible=true"

The example refers to JBoss

Blog at WordPress.com.