2015年2月29日课后作业

  1. 网站开发所需要的技术以及工具

        Access数据库、Dreamweaver、HTML标记、VBScript脚本、ASP活动页面技术、SQL结构化查询指令、ADO操作Access数据库的方法。

  2课堂测试的程序源代码,以及结果截图

   程序源代码: index.jsp:

<%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030"%>
<%@ page import="java.sql.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<title>Insert title here</title>
</head>
<body>
<%
try{
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
String url="jdbc:sqlserver://localhost:1433; DatabaseName=Test";
String username="110110";
String password="swz20142894";

String user_name=request.getParameter("name");
String user_pass=request.getParameter("psd");

Connection conn=DriverManager.getConnection(url, username, password);
if(conn!=null){
out.println("数据库连接成功!");

Statement sm =conn.createStatement(); //创建Statement


ResultSet rs=sm.executeQuery("select * from users where name='"+user_name+"'"+"and psd='"+user_pass+"'");
if(rs.next()){
response.sendRedirect("receive.jsp");
}

conn.close();
}else{
out.println("数据库连接失败!");
}
}catch(ClassNotFoundException e){
e.printStackTrace();
}
%>
</body>
</html>

login.jsp:

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<form action="index.jsp" method="post">
登录页面<br>
账号<input type="text" name="name"/><br/>
密码<input type="password" name="psd">
<input type="submit"name="submit"value="login" >
</form>
</body>
</html>

receive.jsp:

<%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<title>Insert title here</title>
</head>
<body>
登陆成功
</body>
</html>

运行结果截图:

  3.没有完成作业的原因

      假期里并没有好好的利用时间踏下心来做点有意义的事情比如说复习或者预习一些知识或者老师完成的作业,放假后心也跟着放飞了生活里少了自己学习的影子。

 4.这门课程希望达成的目标以及将会在课程中的投入时间

      希望以后的时间里更加珍惜自己的大学时光多学点知识,首先将老师上课讲的东西慢慢弄懂再到熟练,最后到精通学到真正对自己有用的东西以及锻炼自己的学习品质,自学自觉能力。

     在时间投入上想要达成以上目标我觉得空想是绝对不现实的,我以后大部分时光打算用在学习上,而我将会首先温习软件工程概论这门学科,如果精确到时间上的话,那大概是每天一个半小时左右。

 

posted @ 2016-02-29 16:13  码农小正  阅读(170)  评论(1编辑  收藏  举报