wood burning stoves 2.0*
The moose likes JDBC and the fly likes inserting date into database using jdbc Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "inserting date into database using jdbc" Watch "inserting date into database using jdbc" New topic

inserting date into database using jdbc

Bhasker Reddy
Ranch Hand

Joined: Jun 13, 2000
Posts: 176
PreparedStatement stmt_utl = dbconn.prepareStatement("INSERT INTO UTL_PROD_HISTORY VALUES (?,?,?,?,?)");
stmt_utl.setInt(1, y);
stmt_utl.setString(3, userid_uc);
stmt_utl.setString(4, proc_name);
stmt_utl.setInt(5, num);

I am having problems inserting date into the database, how
do i retreive the date from the system.
My database is oracle, i am working on java servlets using jdbc
can anyone suggest me something

Bhasker Reddy
Daniel Dunleavy
Ranch Hand

Joined: Mar 13, 2001
Posts: 276
first off, you can make the date field have a default value of sysdate
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

How about this?

I agree. Here's the link: http://aspose.com/file-tools
subject: inserting date into database using jdbc