Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

date

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
What is the best way to format a date on and oracle insert statement ideally (dd-MON-yy) in a jsp.

Right now I am using a prepared statement and assigning the bind variables for the insert statement, but the date is hardcoded at this point

is there a way to use oracles sysdate?

thanks in advance
 
You could add the date to the prepared statement and then create a java.sql.Date. This would allow you to use the setDate( int, Date ) from the PreparedStatement class. There is also a method setDate( int, Date, Calendar ) that I believe uses the calendar object to contruct the date to be used in the sql.

-gc "I don't look busy because I did it right the first time."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top