开发者

Java to Oracle - Correct date format to use

We have a Java webapp that talks to an Oracle database. We are keeping track of a particular time (timestamp format in Oracle) and we were wondering what would be the best time format in java to use.

The da开发者_JAVA百科tabase we are talking to could be in the US or Europe so we need a java type that will allow us to use Locales.

What in peoples opinion would be the best Java type to use?


You should use java.sql.Timestamp together with a PreparedStatement then you don't need to worry about a "format" at all.


What is the datatype of the Oracle field that you are storing timestamp?

Make sure it preserves timezone data.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜