File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases 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
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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:
subject: inserting date into database using jdbc
It's not a secret anymore!