how to insert date into database using jsp?
Yes it was that!
ResultSet rs=st.executeQuery(sql); // ^^^
No! Use:
ResultSet rs=st.executeQuery();
Or better
st.executeUpdate();
When you call executeQuery(sql)
, you in fact call the inherited Statement.executeQuery
that won't use your prepared statement at all.