資源簡介
基于jsp開發(fā)的具有數(shù)據(jù)庫的mvc構(gòu)架登錄系統(tǒng)

代碼片段和文件信息
package?pdsu.edu.cn.chu;
import?java.sql.*;
public?class?UserManger?
{
private?String?username;
private?String?password;
private?String?email;
public?UserManger()
{}
public?String?getUsername()?{
return?username;
}
public?void?setUsername(String?username)?{
this.username?=?username;
}
public?String?getPassword()?{
return?password;
}
public?void?setPassword(String?password)?{
this.password?=?password;
}
public?String?getEmail()?{
return?email;
}
public?void?setEmail(String?email)?{
this.email?=?email;
}
public?Connection?getConn()
{
Connection?conn=null;
try
{
Class.forName(“com.microsoft.jdbc.sqlserver.SQLServerDriver“);
}
catch(Exception?e)
{
}
try
{
conn=DriverManager.getConnection(“jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=test““sa“““);
}
catch(Exception?ex)
{
}
return?conn;
}
public?boolean?Register()
{
try
{
Connection?con?=?getConn();
Statement?stmt?=?con.createStatement();
stmt.executeUpdate(“insert?into?tb_user?values(‘“+username+“‘‘“+password+“‘‘“+email+“‘)“);
return?true;
}
catch(Exception?ex)
{
return?false;
}
}
public?boolean?Login()
{
try
{
Connection?con?=?getConn();
Statement?stmt?=?con.createStatement();
ResultSet?rs=stmt.executeQuery(“select?count(*)?from?tb_user?where?username=‘“+username+“‘?and?password=‘“+password+“‘?“);
rs.next();
int?count=rs.getInt(1);
if(count==1)
{
return?true;
}
else
{
return?false;
}
}
catch(Exception?ex)
{
return?false;
}
}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2012-09-29?13:13??ATest\
?????文件?????????574??2012-05-14?15:00??ATest\.classpath
?????目錄???????????0??2012-10-31?22:37??ATest\.myeclipse\
?????文件?????????288??2012-05-14?14:54??ATest\.myme
?????文件????????1223??2012-05-14?15:39??ATest\.project
?????目錄???????????0??2012-09-29?13:13??ATest\WebRoot\
?????文件????????1115??2012-05-14?15:33??ATest\WebRoot\Login.jsp
?????目錄???????????0??2012-09-29?13:13??ATest\WebRoot\me
?????文件??????????39??2012-05-14?14:54??ATest\WebRoot\me
?????文件?????????938??2012-05-14?16:13??ATest\WebRoot\Mem.jsp
?????文件????????1133??2012-05-14?15:38??ATest\WebRoot\Reg.jsp
?????文件????????1370??2012-05-14?15:36??ATest\WebRoot\Register.jsp
?????目錄???????????0??2012-09-29?13:13??ATest\WebRoot\WEB-INF\
?????目錄???????????0??2012-09-29?13:13??ATest\WebRoot\WEB-INF\classes\
?????目錄???????????0??2012-09-29?13:13??ATest\WebRoot\WEB-INF\classes\pdsu\
?????目錄???????????0??2012-09-29?13:13??ATest\WebRoot\WEB-INF\classes\pdsu\edu\
?????目錄???????????0??2012-09-29?13:13??ATest\WebRoot\WEB-INF\classes\pdsu\edu\cn\
?????目錄???????????0??2012-09-29?13:13??ATest\WebRoot\WEB-INF\classes\pdsu\edu\cn\chu\
?????文件????????2604??2012-05-14?15:24??ATest\WebRoot\WEB-INF\classes\pdsu\edu\cn\chu\UserManger.class
?????目錄???????????0??2012-09-29?13:13??ATest\WebRoot\WEB-INF\lib\
?????文件??????286707??2012-05-14?15:00??ATest\WebRoot\WEB-INF\lib\msba
?????文件???????67024??2012-05-14?15:00??ATest\WebRoot\WEB-INF\lib\mssqlserver.jar
?????文件???????58903??2012-05-14?15:00??ATest\WebRoot\WEB-INF\lib\msutil.jar
?????文件?????????381??2012-05-14?14:54??ATest\WebRoot\WEB-INF\web.xm
?????文件????????1372??2012-05-14?15:29??ATest\WebRoot\index.jsp
?????目錄???????????0??2012-09-29?13:13??ATest\src\
?????目錄???????????0??2012-09-29?13:13??ATest\src\pdsu\
?????目錄???????????0??2012-09-29?13:13??ATest\src\pdsu\edu\
?????目錄???????????0??2012-09-29?13:13??ATest\src\pdsu\edu\cn\
?????目錄???????????0??2012-09-29?13:13??ATest\src\pdsu\edu\cn\chu\
?????文件????????1671??2012-05-14?15:24??ATest\src\pdsu\edu\cn\chu\UserManger.java
............此處省略0個文件信息
評論
共有 條評論