Sanjeev-
At first glance, your code looks good. I suspect that the user that Tomcat
runs as has not been granted access to the "names" table at the SQL level.
You are probably running psql as the user who created the table, so you can
see it fine at the sql command prompt, but Tomcat is probably running as
user "tomcat" or "www-data".
I think "ps axu" would show you the user that tomcat is running as.
-Nick
--------------------------------------------------------------------------
Nick Fankhauser nickf@ontko.com Phone 1.765.935.4283 Fax 1.765.962.9788
Ray Ontko & Co. Software Consulting Services http://www.ontko.com/