File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes prepared statements and sysdate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "prepared statements and sysdate" Watch "prepared statements and sysdate" New topic
Author

prepared statements and sysdate

binu narayanan
Ranch Hand

Joined: Jul 24, 2009
Posts: 56
somebody help me
While using prepared statements how to insert the sysdate into a field
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Define it as a default constraint and it will be inserted whenever you create a new record.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
binu narayanan
Ranch Hand

Joined: Jul 24, 2009
Posts: 56
thanks i got it.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19696
    
  20

And if that's not possible, use "new Timestamp(System.currentTimeMillis());"


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: prepared statements and sysdate