哪位大哥帮小弟看看
java.lang.NullPointerExceptionpackage JavaBean;
import java.sql.*;
import java.io.PrintWriter;
public class DB_conn{
private Connection conn=null;
public Statement sm=null;
private PrintWriter out = null;
public void connectDB(){
try{
Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver ").newInstance();
conn=DriverManager.getConnection( "jdbc:odbc:shop ", "sa ", " ");
sm=conn.createStatement();
}
catch(Exception e){
out.print( "数据库
连接失败! ");
}
}
public void closeDB(){
try{
if(sm!=null)
{
sm.close();
}
conn.close();
}
catch(Exception e){
out.println( "数据库关闭失败! ");
}
}
}
package JavaBean;
public class user{
private int userid;
private String username;
private String pwd;
private String email;
private int gender;
private String strgender;
private String tel;
public int getuserid() {
return userid;
}
public void setuserid(int id) {
this.userid=id;
}
public String getusername() {
return username;
}
public void setusername(String username) {
this.username=username;
}
public String getpwd() {
return pwd;
}
public void setpwd(String pwd) {
this.pwd=pwd;
}
public String getemail() {
return email;
}
public void setemail(String email) {
this.email=email;
}
public int getgender() {
return gender;
}
public void setgender(int gender) {
this.gender=gender;
}
public String getstrgender(){
if (gender == 0)
strgender= "女 ";
else
strgender= "男 ";
return strgender;
}
public String gettel() {
return tel;
}
public void settel(String tel) {