1
I have a question, I want to be able to concatenate a String, so that it is interpreted with simple apostrophes between it.
For example, SQL would look like this:
SELECT IDALUNO, NOME, DATANASCIMENTO FROM ALUNO WHERE DATANASCIMENTO BETWEEN '07/03/1997' AND '10/03/2018';
What I want is that instead of the dates '07/03/1997' AND '10/03/2018'
I can put two variables of the string type.
Example:
SELECT IDALUNO, NOME, DATANASCIMENTO FROM ALUNO WHERE DATANASCIMENTO BETWEEN 'dataInicial' AND 'dataFinal';
From Java 8 an alternative to the use of
java.sql.Date
is to match package objectsjava.time
(e. g.,LocalDate
) withstmt.setObject
. For more details see: https://stackoverflow.com/a/31238011/664577– Anthony Accioly