jsp分页技术(1)
package com.sp.model;
import java.sql.*;
import java.util.*;
public class UserbeanCl {
//业务逻辑
private Connection ct=null;
private PreparedStatement ps=null;
private ResultSet rs=null;
private int pageCount=0;//共有几页(计算)
//分页显示
//修改用户
public boolean update(String s1,String s2,String s3,String s4,String s5,String s6,String s7,String s8,String s9){
boolean b=false;
//
private long
userId ;
//
private String username ;
//
private String truename ;
//
private String passwd ;
//
private String email ;
//
private String phone ;
//
private String address ;
//
private String postcode ;
//
private int grade ;
//
try{
ConnDB cd=new ConnDB();
ct=cd.getCon();
ps=ct.prepareStatement("update users set username='"+s2+"' , passwd='"+s3+"', email='"+s4+"', grade="+s5+"', truename="+s6+"', phone="+s7+"', address="+s8+"', postcode="+s9+" where userId='"+s1+"'");
int num= ps.executeUpdate();
if(num==1){
b=true;
}
}catch(Exception e){
e.printStackTrace();
}finally{
this.close();
}
return b;
}
//增加用户信息,
//增加用户放在注册用户上
//
public boolean addUser(String s2,String s3,String s4,String s5){
//
boolean b=false;
//
try{
//
ConnDB cd=new ConnDB();
//
ct=cd.getCon();
//
ps=ct.prepareStatement("insert into &n