日期:2014-05-16  浏览次数:20420 次

Jsp+Servlet+JavaBean+JDBC登陆实例
运行环境:
引用
JDK1.5
Tomcat5.5
MyEclips5.5.1 GA
SqlServer2000
windows2003


1.在SqlServer下的查询分析器中新建表:
Sql代码  收藏代码
  1. create table dbuser(  
  2. userId int identity(1,1) primary key not null,  
  3. userName varchar(50),  
  4. userPasswd varchar(50))  


2.在MyEclipse中新建Web工程,并创建包结构。




3.编写登陆界面。
Html代码  收藏代码
  1. <%@ page language="java" contentType="text/html; charset=GB18030"  
  2.     pageEncoding="GB18030"%>  
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">  
  4. <html>  
  5. <head>  
  6. <meta http-equiv="Content-Type" content="text/html; charset=GB18030">  
  7. <title>Insert title here</title>  
  8. <style type="text/css">  
  9. body{  
  10.  color : #000 ;  
  11.  font-size : 12px ;  
  12.   
  13.  margin : 0px aut