Subject | Re: Inserting DATES |
---|---|
Author | Roman Rokytskyy |
Post date | 2003-09-22T12:47:38Z |
> How can I INSERT dates using a Stored Procedure? I mean if I have aYes.
> JTextField with the date and I want to insert as a parameter, should
> I convert to something?
> what should be that?java.sql.Date, java.sql.Time or java.sql.Timestamp.
> I tryed this way but I had an error:You created instance of java.util.Date, but should java.sql.Date.
>
> Date dateField = new Date( jTextFieldDate.getText() );
> p.setDate(4, dateField);
>
>
> error:
> cannot resolve symbol
> symbol : method setDate (int,java.util.Date)
> location: interface java.sql.CallableStatement
java.sql.Date dateField = new java.sql.Date( jTextFieldDate.getText() );
p.setDate(4, dateField);