Java JDBC/MySQL appropriate Syntax
I am having a problem trying to get the correct syntax for a java sql query of a mysql database.
Currently I have:-
result = statement.executeQuery("select account.account_number" +
"from account where account_number =" +accountNumberIn);
I keep getting a syntax error message:-
com.mysql.jdbc.exceptions.MySQLSyntaxErrorExceptio n: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where account_number =11111111' at line 1
where 11111111 is the value of accountNumberIn.
I would appreciate help from anyone who might know the correct syntax for such a query.