I am trying to use a prepared statement to select a particular row or a set of rows (does not matter ! ). I could use prepared statement to update rows but not to retrieve them from a MySQL Database.
I used parametric statements in other languages like php and asp, it must be a solution with JDBC, to get a result from a parametric query.
The code runs without errors but also without results !
Faiz Abdelhafid wrote:
Yes in fact you mentioned that before, but you also wrote that my sql query is invalid.
besides the parameters where is the problem ?
here is your code:
so your query is like this:
I am not an SQL expert, but as I know, comparison (logical) operator '=' is allowed in expressions after a WHERE/HAVING keywords,
but is not allowed after a SELECT keyword.
I tried to run this query on Oracle and got an error: "FROM keyword not found where expected"
Joined: Nov 21, 2009
I already found the correct syntax. First, I thought that Java parametric Queries are just like any other language, but it's a little bit different from PHP and ASP.