Re: [JSP ] SQL與rs.getString的問題
: 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
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 4 之 5 篇):