| Author |
Insert Date With Time Prepared Stament...?
|
jawwad ahmed
Ranch Hand
Joined: Dec 01, 2001
Posts: 179
|
posted

0
|
Well i am not able to insert date with time with prepared stament.I dont know where i am going wrong.It gives error missing comma. String qury = "insert into schedule (schedule_id,account_id,schedule_title,remarks,detail,to_date(schedule_date,'DD-MON-YY HH:MI')) values (?,?,?,?,?,?)"; PreparedStatement stmt2=dbConnection.prepareStatement(qury); stmt2.setInt(1,maxid); stmt2.setString(2,accountId); stmt2.setString(3,title); stmt2.setString(4,remarks); stmt2.setString(5,detail); stmt2.setString(6,"03-APR-03 12:12"); int res=stmt2.executeUpdate(); response.sendRedirect("home.jsp"); ////////////////////////////////////////////////////
|
 |
SJ Adnams
Ranch Hand
Joined: Sep 28, 2001
Posts: 925
|
|
|
use setDate()
|
 |
 |
|
|
subject: Insert Date With Time Prepared Stament...?
|
|
|