📄 customerpwdbean.java
字号:
package Model_Customer;
import DataBase.ConDataBase;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.Types;
public class CustomerPwdBean
{
public CustomerPwdBean()
{
}
public String InsertCustomerPwd(CustomerPwd cp)
{
Connection con=ConDataBase.getConnection();
try{
CallableStatement cmst=con.prepareCall("{call INSERTUSERLOGIN(?,?,?)}");
cmst.setString(1,cp.getCustomerID());
cmst.setString(2,cp.getPwd());
cmst.registerOutParameter(3,Types.VARCHAR);
cmst.execute();
String re=cmst.getString(3);
return re;
}
catch(Exception e)
{
System.out.println(e.getMessage());
return e.getMessage();
}
}
public String UpdateCustomerPwd(CustomerPwd cp)
{
Connection con=ConDataBase.getConnection();
try{
CallableStatement cmst=con.prepareCall("{call UPDATECUSTOMERPWD(?,?,?,?)}");
cmst.setString(1,cp.getCustomerID());
cmst.setString(2,cp.getPwd());
cmst.setString(3,cp.getPurview());
cmst.registerOutParameter(4,Types.VARCHAR);
cmst.execute();
String re=cmst.getString(4);
return re;
}
catch(Exception e)
{
System.out.println(e.getMessage());
return e.getMessage();
}
}
public String DeleteCustomerPwd(String customerid)
{
Connection con=ConDataBase.getConnection();
try{
CallableStatement cmst=con.prepareCall("{call DELETECUSTOMERPWD(?,?)}");
cmst.setString(1,customerid);
cmst.registerOutParameter(2,Types.VARCHAR);
cmst.execute();
String re=cmst.getString(2);
return re;
}
catch(Exception e)
{
System.out.println(e.getMessage());
return e.getMessage();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -