A date format that enters the DATE data of phpmyadmin

0

I have a secure table with the following list of variables:

int idSeguro;
String nif;
String nombre;
String ape1;
String ape2;
int edad;
int numHijos;
LocalDate fechaCreacion;

And I want to relate it to this table that I have in phpMyAdmin.

And this is what I see when I try to enter a row in the table.

How do I get the date correctly?

    
asked by Miguel Alparez 26.02.2018 в 13:32
source

1 answer

1

I have already fixed it. I had forgotten that when entering a value in the table in the DATE variable, I should put it with its quotes, just like the String.

int d=s.executeUpdate("insert into seguro values("+seguro.idSeguro+",'"+seguro.nif+"','"             +seguro.nombre+"','"+seguro.ape1+"','"+seguro.ape2+"','"+seguro.edad+"',"
                +seguro.numHijos+",'"+seguro.fechaCreacion+"')");
    
answered by 26.02.2018 в 13:34