Check the PreparedStatement
docs on how to use it properly.
You should write your query as follows -
pst = con.prepareStatement("SELECT * FROM flight WHERE route_id= ? AND date_dep= ?");
And set the arguments as follows -
//pst.setXXX(1, routed); just choose the appropriate type for the route_id column
pst.setDate(2, dateCh.getDate());
Note that currently you are not even enclosing your arguments in quotes. A properly written query would look something like ... where col1 = 'val1' and col2 = 'val2' ...
.
When you do something like ... "AND date_dep="+dateCh.getDate() ...
, that's equivalent to doing ..."AND date_dep="+dateCh.getDate().toString()...
. Which eventually yields something like ... AND date_dep=Apr ...
.