Subject Re: Inserting DATES
Author Roman Rokytskyy
> How can I INSERT dates using a Stored Procedure? I mean if I have a
> JTextField with the date and I want to insert as a parameter, should
> I convert to something?

Yes.

> what should be that?

java.sql.Date, java.sql.Time or java.sql.Timestamp.

> I tryed this way but I had an error:
>
> 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

You created instance of java.util.Date, but should java.sql.Date.

java.sql.Date dateField = new java.sql.Date( jTextFieldDate.getText() );
p.setDate(4, dateField);