Re: [JSP ] SQL與rs.getString的問題

看板java作者 (愚人)時間18年前 (2007/11/12 21:07), 編輯推噓2(200)
留言2則, 2人參與, 最新討論串4/5 (看更多)
: if(rs1.next()){ : while(rs1.next()){ : String SQL2 = "SELECT "+session.getAttribute("Role")+" FROM lvl : WHERE 功能 = '"+rs1.getString(2)+"'"; http://java.sun.com/j2se/1.4.2/docs/api/java/sql/ResultSet.html#next() Moves the cursor down one row from its current position. A ResultSet cursor is initially positioned before the first row; the first call to the method next makes the first row the current row; the second call makes the second row the current row, and so on. 你多 move 了 還有您的痛苦來自於用了難用的方法 用 Prepared Statement 會輕鬆且安全一點 http://java.sun.com/docs/books/tutorial/jdbc/basics/prepared.html -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 218.167.103.78

11/12 21:48, , 1F
這未必是錯誤來源啊啊啊...
11/12 21:48, 1F

11/12 22:32, , 2F
先改成容易成功的方法, 會讓自己的人蔘不會那麼苦澀
11/12 22:32, 2F
文章代碼(AID): #17E50W_y (java)
討論串 (同標題文章)
文章代碼(AID): #17E50W_y (java)