jsp实战型程序连载,由于一个朋友最近在搞jsp,需要点资料,所以呢就收集些经常用到的实战型jsp片段供大家参考,有很多东西可以直接拿来用的,哪怕你只懂一点点语法,我相信如果你能关注本连载也会做简单jsp的。谢谢关注。
从登陆验证开始吧:
string username = null;
string userpasssword = null;
string testname = jtextfield1.gettext().tostring();
string testpassword = string.valueof(jtextfield2.gettext());
string querystring = "select testname ,testpassword from admin";
try {
statement conn = database1.createstatement();
resultset rs = conn.executequery(querystring);
username = rs.getstring("username");
userpasssword = rs.getstring("password");
} catch (sqlexception ex) {
}
system.out.println(username);
system.out.println(userpasssword);
system.out.println(testname);
system.out.println(testpassword);
新闻热点
疑难解答