1、编写一个学生信息注册页面,并把学生信息写入数据库名称为stuinfo的数据库中
2、编写一个学生登录页面(从stuinfo数据库中读取学生信息)
3、编写学生管理页面,实现学生信息的增删改查等操作
首先创建一个表单来限制登陆页面,限制表单的样式以及行类的变化:
<link rel="stylesheet" href="css/bootstrap.css">
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/bootstrap.bundle.js"></script>
<style>
.container{
width: 20%;
height: 20%;
margin-top:10% ;
}
</style>
</head>
<body>
<div class="container">
<div class="row clearfix">
<div class="col-md-12 column">
<form role="form" action="index.jsp">
<h3 style="text-align:center">登录 </h3>
<div class="form-group">
<label for="exampleInputEmail1">用户名:</label><input type="text" class="form-control" name = "username" id="exampleInputEmail1" />
</div>
<div class="form-group">
<label for="exampleInputPassword1">密码:</label><input type="password" class="form-control" name="password" id="exampleInputPassword1" />
</div>
<div class="form-group"></div>
<button type="submit" class="btn btn-default">提交</button>
</form>
</div>
</div>
</div>
实现以下的面板构造
填写如下:
实现增删改查
增加:
<%
String sql = "insert into user (username,password,gender,age) values (?,?,?,?)"; //在PreparedStatement 中使用问好代替实际参数
PreparedStatement ps = connection.prepareStatement(sql)