I am developing a java app, and I use resultset. I write this query, it works and I get the results
SELECT *
FROM BD
WHERE
CAST(parent_id AS integer) = " + (Integer.parseInt(arrHeading[0])) + "
AND CAST(section AS double precision) = " + Double.parseDouble(arrHeading[1]) + "";
arrHeading is type string, but when I write the query below it does not return any results. cas is type character varying(12). I am having trouble because it's a character, and I dont know why I am not getting any result. I tried with the quotes but still does not work. Any ideas?
SELECT *
FROM BD
WHERE
CAST(parent_id AS integer) = " + (Integer.parseInt(arrHeading[0])) + "
AND CAST(section AS double precision) = " + Double.parseDouble(arrHeading[1]) + "
AND cas = '" + arrHeading[2] + "'";