 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Al Guest
|
Posted: Wed Dec 15, 2004 8:09 pm Post subject: "Results returned for UPDATE ONLY" |
|
|
I just put together some servlets to communicate with MYSQL. One merely
accepts a string as input in a form and sends it to MYSQL. I have a table
named 'articles', with columns 'name' and 'summary'. I can INSERT values
in to the table, by sending:
insert into articles (name,summary) values ('a', 'b')
That works fine. But when I try:
select * from articles
I get the error:
java.sql.SQLException: Results returned for UPDATE ONLY.
What am i doing wrong? Thanks.
|
|
| Back to top |
|
 |
Mark Matthews Guest
|
Posted: Wed Dec 15, 2004 10:32 pm Post subject: Re: "Results returned for UPDATE ONLY" |
|
|
Al wrote:
| Quote: | I just put together some servlets to communicate with MYSQL. One merely
accepts a string as input in a form and sends it to MYSQL. I have a table
named 'articles', with columns 'name' and 'summary'. I can INSERT values
in to the table, by sending:
insert into articles (name,summary) values ('a', 'b')
That works fine. But when I try:
select * from articles
I get the error:
java.sql.SQLException: Results returned for UPDATE ONLY.
What am i doing wrong? Thanks.
|
Al,
My guess is you're calling Statement.executeUpdate("SELECT ..."), which
is not allowed by the JDBC spec...You should use
Statement.executeQuery(""), if you _know_ result set(s) will be
returned, and Statement.execute(""), if you don't know ahead-of-time
whether the operation is DML or a query.
Regards,
-Mark
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|