Li Jenny wrote:when i enter number to retrieve that field as below:
select * from ATable where field='123';
it causes sql syntax error
This SQL is syntactically correct. The problem is the SQL query which gets formatted when you assign the parameter in JDBC code. I repeat, check the resultant query from JDBC code. The problem is there.