关于servlet中调用数据库连接的问题,对数据库的操作老是无效,求高手指点
我写了三个类,一个是customer类,一个是Register类(专门处理数据连接),一个是Check_validate类,用来判断一些逻辑,也引用了Register的方法
但是在Check_validate中的操作在数据库中一点反应也没有,求高手指点
package BasementClass;
public class Customer{
private String Username;
private String Password;
private String Name;
private String Address;
private String E_mail;
public Customer(String Username,String Password,String Name,String Address,String E_mail){
this.Username=Username;
this.Password=Password;
this.Name=Name;
this.Address=Address;
this.E_mail=E_mail;
}
public String getUsername(){
return Username;
}
public String getPassword(){
return Password;
}
public String getName(){
return Name;
}
public String getAddress(){
return Address;
}
public String getE_mail(){
return E_mail;
}
public void setUsername(String username){
Username=username;
}
public void setPassword(String password){
Password=password;
}
public void setName(String name){
Name=name;
}
public void setAddress(String address){
Address=address;
}
public void setE_mail(String e_mail){
E_mail=e_mail;
}
}
package Site_SQL;
import BasementClass.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class Check_validate extends HttpServlet {
String user_name,pwd,re_pwd,address,name,email,note;
Register r;
Customer c;
protected void doGet(HttpServletRequest request,HttpServletResponse response)
throws
ServletException,
IOException {
String docType =
" <!DOCTYPE HTML PUBLIC \ "-//W3C//DTD HTML 4.0 "+ "Transitional//EN\ "> \n ";
response.setContentType( "text/html ");
response.setCharacterEncoding( "UTF-8 ");
PrintWriter out = response.getWriter();
user_name=request.getParameter( "user ");