String query="SELECT *FROM addresses"+
                     "WHERE lastname='"+
                     fields.last.getText()+"'";

What is wrong with the above SQL statement?
I got the error message as "Syntax error in FROM clause"

You need a space between * and FROM and also between adresses and WHERE

Hello! hollystyles

Thanks for your reply.
Now it is working.