Hi,
U r using a simple insert sql so why dont u use
Statement instead of PreparedStatement.
bcos PreparedStatement is used for stored procs and
not simple statements it may be hanging.
cheers
lalit
>From: Manoj Agrawal <[EMAIL PROTECTED]>
>Reply-To: "A mailing list for discussion about Sun Microsystem's Java
> Servlet API Technology." <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Date problem
>Date: Fri, 24 Mar 2000 15:03:00 -0600
>
> Hi
> I am trying to insert a date into Oracle data base and the
>application
> hangs on the insert. Here is the code
>
>
> PreparedStatement put_into_table = con.prepareStatement(
>
> "insert into salereport values ( ? ,?)");
> SimpleDateFormat formatter = new SimpleDateFormat ("dd-MMM-yyyy");
> java.util.Date qryDate = formatter.parse("02-MAR-2000");
> long timeinmilli = qryDate.getTime();
> java.sql.Date sqlDate = new java.sql.Date(timeinmilli);
>
> put_into_table.setDate(1, sqlDate);
> put_into_table.setString(2, lineitemtype);
>
> int row_inserted = put_into_table.executeUpdate();
>
>
> Does any body have any clue what is wrong with this code ?
>
> --ma--
>
>___________________________________________________________________________
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff SERVLET-INTEREST".
>
>Archives: http://archives.java.sun.com/archives/servlet-interest.html
>Resources: http://java.sun.com/products/servlet/external-resources.html
>LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html