General discussion

Locked

setDate in a prepared statement

By wzJakarta ·
What is the correct syntax to 'setDate' in a prepared statement. I'm including java.sql.*, but keep getting 'cannot resolve symbol' error. Statement syntax is: pstmt.setDate(11,updateRec.dAddDt);
dAddDt is declared as: public Date dAddDt;

Thanks for any help....

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

setDate in a prepared statement

by Palani Selvam In reply to setDate in a prepared sta ...

hi wzjakarta,

Date dateobj=new Date(int year,int month,int day);
Date dateobj=new Date(1903,3,3);
pstmt.setDate(index, Date dateobj);

Check out this! hope u should be able to work out

Regards
pal

Collapse -

setDate in a prepared statement

by wzJakarta In reply to setDate in a prepared sta ...

Did not answer question. I resolved it on my own already. Thanks anyway.

Collapse -

setDate in a prepared statement

by Palani Selvam In reply to setDate in a prepared sta ...

hi wzjakarta,

/*Date dateobj=new Date(int year,int month,int day);*/
Date dateobj=new Date(1903,3,3);
pstmt.setDate(index,dateobj);

Check out this! hope u should be able to work out

Regards
pal

Collapse -

setDate in a prepared statement

by wzJakarta In reply to setDate in a prepared sta ...

Did not answer question. I resolved it on my own already. Thanks anyway.

Collapse -

setDate in a prepared statement

by wzJakarta In reply to setDate in a prepared sta ...

Both answers did not answer my question. I resolved issue myself. There was a conflict in import java.sql.* and java.util.*. No further help is needed. Thanks anyway though.

Back to Web Development Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums