From: | "Patrik Lundgren" <patrik(at)mensa(dot)se> |
---|---|
To: | "'Don Park'" <donald(dot)g(dot)park(at)iname(dot)com>, <pgsql-jdbc(at)postgresql(dot)org> |
Subject: | Re: No results were returned by the query. |
Date: | 2003-04-19 20:48:30 |
Message-ID: | 000201c306b5$091ae2b0$0300a8c0@energy |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-jdbc |
Call executeUpdate instead of executeQuery in PreparedStatement.
Regards,
Patrik Lundgren
-----Ursprungligt meddelande-----
Från: pgsql-jdbc-owner(at)postgresql(dot)org
[mailto:pgsql-jdbc-owner(at)postgresql(dot)org] För Don Park
Skickat: Saturday, April 19, 2003 10:42 PM
Till: pgsql-jdbc(at)postgresql(dot)org
Ämne: [JDBC] No results were returned by the query.
I have some postgresql calls in a jsp file. I can do select calls with
no problem. When i do an update call I get
javax.servlet.ServletException: No results were returned by the query
the code snipit is:
PreparedStatement ps = conn.prepareStatement(
"update users set firstname = ? where userid = ?");
ps.setString(1, firstname);
ps.setString(2, userid);
ps.executeQuery();
I dont except any 'results' from an update statment, so im really
confused by the exception. The statement does get executed - i can see
the change in the database. Im just trying to avoid the exception.
Don
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
From | Date | Subject | |
---|---|---|---|
Next Message | Nic Ferrier | 2003-04-19 21:13:18 | build patch |
Previous Message | Don Park | 2003-04-19 20:41:30 | No results were returned by the query. |