| 註冊 | 登入 | 全文檢索 | 排行榜 |
|
|
» JavaWorld@TW
» Servlet/JSP 討論區
|
![]() ![]() ![]()
|
| 本主題所含的標籤 |
| 作者 | Re:[問題]java.sql.SQLException: Can not issue data manipulation statements with executeQuery() [Re:shinelove] | ||||
linexpmail
好玩就好 ![]() ![]() ![]() ![]()
發文: 456 積分: 15 |
參考看看 http://java.sun.com/j2se/1.4.2/docs/guide/jdbc/getstart/statement.html#1003674
不除妄想不求真 |
| 作者 | Re:[問題]java.sql.SQLException: Can not issue data manipulation statements with executeQuery() [Re:shinelove] |
shinelove
![]() ![]() ![]() ![]()
發文: 6 積分: 0 |
謝謝linexpmail的回答~ 我將程式改用Update後..卻出現另一個錯誤 錯誤訊息: description: The server encountered an internal error () that prevented it from fulfilling this request. incompatible types found : int required: java.sql.ResultSet rs=stmt.executeUpdate("insert into `group`(group_id,group_name) values('1','God')"); ^ 麻煩大大們提示一下了...>_< |
| 作者 | Re:[問題]java.sql.SQLException: Can not issue data manipulation statements with executeQuery() [Re:shinelove] |
atriatri
![]() ![]() ![]() ![]()
發文: 110 積分: 0 |
shinelove wrote: 請注意 : stmt.executeQuery 傳回 ResultSet stmt.executeUpdate 傳回 int 所以你的程式當然會出現error |
| 作者 | Re:[問題]java.sql.SQLException: Can not issue data manipulation statements with executeQuery() [Re:shinelove] |
shinelove
![]() ![]() ![]() ![]()
發文: 6 積分: 0 |
謝謝atriatri的提示~ 之前用SQL2000不知為什麼用Query就可以新刪修了~ 以致於我有了錯誤的觀念~ 現在我的問題已經解決了~再次感謝 |
| 作者 | Re:[問題]java.sql.SQLException: Can not issue data manipulation statements with executeQuery() [Re:linexpmail] |
yemen
![]() ![]() ![]() ![]()
發文: 2 積分: 0 |
insert语句是用executeUpdate(sql) 而不是executeQuery(). |
| » JavaWorld@TW » Servlet/JSP 討論區 |
![]() ![]() ![]()
|
已讀文章 新的文章 被刪除的文章 |