Insert into the database a value of type date [duplicate]

0

How can I insert the value of a date, for example 2018-06-12, into the database from a java application? I have the application made in javafxml and when I run the application and I enter the date and the rest of the values it gives me this error "com.microsoft.sqlserver.jdbc.SQLServerException: Operand type clash: int is incompatible with date". The type of the variable in the DB is date and when I insert it into a TextField it gives me this error.

    String SQLquery1 = "INSERT INTO Marcacao(IdMarcacao,IdUtente,IdServico,DataMarcacao)"
                            + "VALUES (" + id + "," + IdUtenteAgendar.getText() + "," + IdServicoAgendar.getText() + "," + dataHoje.getText() + ");";        
    
asked by anonymous 11.06.2018 / 01:52

0 answers