I am having some problems with running some oracle statements on a java servlet. I am making a prepared statement like so
[b]stmt = m_con.prepareStatement("SELECT NAME, TORRENT_USER, TYPE FROM " +
"TORRENTFILES WHERE NAME " +
"LIKE '%" + torrentName + "%' ? ?");[/b]
and if someone searches on different settings, you can get different searches with
stmt.setString(1, "AND TYPE='" + type + "'");
stmt.setString(2, "AND USERNAME='" + userName + "'");
When I test the search with a basic search just on name, it tells me that the command is not properly finished. I have tried searching through this, but from what I can find, most things say that it appears when there is a group by or order by. Can anyone help?