It's not a secret anymore!
The moose likes JDBC and Relational Databases and the fly likes JDBC( sql.Date and util.Date) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "JDBC( sql.Date and util.Date)" Watch "JDBC( sql.Date and util.Date)" New topic

JDBC( sql.Date and util.Date)

Prasath Manohar

Joined: Mar 21, 2006
Posts: 2
Can I store the System's current Date to Oracle DB.If so can I use both sql.Date and util.Date in the same jdbc program,try to explain me with an example...
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3740

Do you want the application server's date/time or the database server's date/time, because both are available. Oracle has a sys time command whereas java just requires you create a new date. Depending on how you want to use it, you might consider a database solution that automatically inserts in a timestamp when the record is inserted.

[OCA 8 Book] [Blog]
I agree. Here's the link:
subject: JDBC( sql.Date and util.Date)
It's not a secret anymore!