Do you know how to use your debugger? If so please put a break on your "ResultSet rs = " line and debug the program, when you hit that breakpoint please post the full SQL statement that you have in your execution path--the resulting SQL statement after your variables are evaluated or enter that SQL directly into your MySQL editor and see what error message you get. Once we have the SQL statement that is causing the problem, then we can look at getting an answer, but before then I'm not looking further.
ramesh suresh wrote:
error is :
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 ''4'' at line 1
\\i entered 4 in text box...
thanks in advance
Out on HF and heard nobody, but didn't call CQ? Nobody heard you either. 73 de N7GH
1) Don't quote number. Your query contains limit '4' where it should be limit 4 - without quotes.
2) You will probably need to put backticks (`) around transaction (`transaction`), because that's a reserved word.
3) Use a PreparedStatement to prevent SQL injection with the account number.
4) Make sure that number is numeric to prevent SQL injection.