Data base Connection Error

Please say me why this error came

Error occurred org.postgresql.util.PSQLException: The column index is out of range: 0, number of columns: 0.

code below

stmt = conn.prepareStatement("SELECT * FROM AddressList");

stmt.setString(1,"Jam");

result = stmt.executeQuery();

stmt.close();

conn.close();

[349 byte] By [codename47a] at [2007-11-27 10:41:38]
# 1

No columns in table, so column 0 doesn't exist...

CeciNEstPasUnProgrammeura at 2007-7-28 19:13:50 > top of Java-index,Java Essentials,New To Java...
# 2

Also, your sql statement is wrong. Should be something like:

"Select * from AddressList where person_id=?"

wherestmt.setString(1,"Jam") is substituted in for the question mark.

George123a at 2007-7-28 19:13:50 > top of Java-index,Java Essentials,New To Java...