Parameter index out of range (4 > number of parameters,which is 3).public class UserDAOImpl implements IUserDAO {\x05private Connection conn = null ;\x05private PreparedStatement pstmt = null ;\x05public UserDAOImpl(Connection conn){\x05\x05this.conn

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/17 20:41:33
Parameter index out of range (4 > number of parameters,which is 3).public class UserDAOImpl implements IUserDAO {\x05private Connection conn = null ;\x05private PreparedStatement pstmt = null ;\x05public UserDAOImpl(Connection conn){\x05\x05this.conn
xV]OG+Wt]mס!C ZJĆ/W]ngfc~$!D%GTB*CbԻOY.4}kΜ{Ν3qnL/AX$Up<0.P&` W^itc,W+%(bJsE2ua67ϕ], eB\4?^2.:CXoaltbn0, |drQvJu*ԕ(Y\CE/ayi9,I] Wuʵt'6+E, Q4L]03Ĝ l nNw&40 eB õ֗ࡴ7A^:bjvvއ kaEl!d<9S3wrz2*=Ms{l'2&Vv {(ǙI 7=V^kIa\*TOQp\+2|1֣-xH%>#")ȡY!1Zc# (%[pl"V\ґ楳r;. #^갂0l>~Qↆŏ3{Wp2ۃz 52^!w}>ڍ\]Aݬj_ޛ۴b:=QeQdu3&>Rp.&\ ttg; \ͤݩ;] [cދήIsWSid?Xxچ_j~ܹ8lՏ7pfpF}ZZ= = vkx+6wo ~Mzp^ aϯNS|Cd89'G_n;->^YɦC8}O@Yѡь. +%O{k|#iE[?GkWl|cqs

Parameter index out of range (4 > number of parameters,which is 3).public class UserDAOImpl implements IUserDAO {\x05private Connection conn = null ;\x05private PreparedStatement pstmt = null ;\x05public UserDAOImpl(Connection conn){\x05\x05this.conn
Parameter index out of range (4 > number of parameters,which is 3).
public class UserDAOImpl implements IUserDAO {
\x05private Connection conn = null ;
\x05private PreparedStatement pstmt = null ;
\x05public UserDAOImpl(Connection conn){
\x05\x05this.conn = conn ;
\x05}
\x05
\x05
\x05public User select(String username,String password) throws Exception {
\x05\x05// TODO Auto-generated method stub
\x05\x05User user = null ;
\x05\x05String sql = "SELECT * FROM userinfo WHERE username=?and password=?" ;
\x05\x05this.pstmt = this.conn.prepareStatement(sql) ;
\x05\x05this.pstmt.setString(1,username) ;
\x05\x05this.pstmt.setString(2,password);
\x05\x05ResultSet rs = this.pstmt.executeQuery() ;
\x05\x05if(rs.next()){
\x05\x05\x05System.out.println("ok");
\x05\x05\x05user = new User() ;
\x05\x05\x05user.setUserid(rs.getInt(1));
\x05\x05\x05user.setUsername(rs.getString(2));
\x05\x05\x05
\x05\x05\x05user.setRealname(rs.getString(4));
\x05\x05\x05user.setRoletype(rs.getInt(5));
\x05\x05\x05user.setUserstate(rs.getInt(6));
\x05\x05\x05user.setDesc(rs.getString(7));
\x05\x05}
\x05\x05this.pstmt.close() ;
\x05\x05return user ;
\x05}
\x05
\x05public int userInsert(String username,String password,int roletype) throws Exception
\x05{
\x05\x05String insertCondition = "INSERT INTO userinfo VALUES (null,,,)" ;
\x05\x05this.pstmt = this.conn.prepareStatement(insertCondition) ;
\x05\x05this.pstmt.setString(1,username);
\x05\x05this.pstmt.setString(2,password);
\x05\x05//this.pstmt.setString(3,realname);
\x05\x05this.pstmt.setInt(4,roletype);
\x05\x05//this.pstmt.setInt(5,0);
\x05\x05//this.pstmt.setString(6,desc);
\x05\x05int n = this.pstmt.executeUpdate();
\x05\x05this.pstmt.close() ;
\x05\x05return n;
\x05}
\x05
}

Parameter index out of range (4 > number of parameters,which is 3).public class UserDAOImpl implements IUserDAO {\x05private Connection conn = null ;\x05private PreparedStatement pstmt = null ;\x05public UserDAOImpl(Connection conn){\x05\x05this.conn
insert into userinfo() values();userinfo字段补全

这是我的程序运行之后出现的错误 怎么回事 问题补充:急用 你的sql语句少了问号你的sql语句有问题我又把数据库的表顺序改了, !!但出现了这个Column count doesn't match value count at row 1 String insertCondition = "INSERT INTO userinfo VALUES (null,?,?,?)" ; 。。 th...

全部展开

这是我的程序运行之后出现的错误 怎么回事 问题补充:急用 你的sql语句少了问号你的sql语句有问题

收起