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 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
Bookmark "inserting date into database using jdbc" Watch "inserting date into database using jdbc" New topic
Author

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.setDate(2,"SYSDATE");
stmt_utl.setString(3, userid_uc);
stmt_utl.setString(4, proc_name);
stmt_utl.setInt(5, num);

stmt_utl.executeUpdate();
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
Dan
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
 
Similar Threads
Date Insertion using XSU...
inserting date and time into database
Inserting date in database
SQL Dates
Insert date using SQL task