码迷,mamicode.com
首页 > 其他好文 > 详细

今天晚上很郁闷

时间:2016-10-29 01:57:14      阅读:138      评论:0      收藏:0      [点我收藏+]

标签:else   .com   head   客户   insert   player   center   hold   rom   

<%@ 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>
<style>
.a
{
    width:500px;
    height:300px;
    background-color:#CCC;
    margin-top:100px;
    margin-left:400px;
    border-radius:10px
    }
.b
{
    width:300px;
    height:40px;
    position:relative;
    float:left;
    margin-left:100px;
    margin-top:20px;
    border:solid 1px #999999;
    border-radius:5px;
    font-size:1.1em;
    }
.c
{
    width:300px;
    height:40px;
    position:relative;
    float:left;
    margin-left:100px;
    margin-top:20px;
    font-size:1.6em;
    color:#333;
    text-align:center
    
    }
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>

<body backgroung="timg.jpg">
<div class="a">
<form action="middle.jsp" method="post">
<div class="c">账号密码登陆</div>
<input type="text" name="name" placeholder="请输入账户名" class="b"/>

<input type="password" name="password" placeholder="请输入密码" class="b"/>

<input type="submit" value="提&nbsp&nbsp交" class="b" />
</form>
</div>
</body>
</html>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.PreparedStatement"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.DriverManager"%>
<%@page import="java.sql.Connection"%>
<%@ 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>
<%
try
{
//接收客户端传递的值
String name = new String(request.getParameter("name").getBytes("ISO-8859-1"),"UTF-8");

String password = new String(request.getParameter("password").getBytes("ISO-8859-1"),"UTF-8");
//加载数据库驱动
Class.forName("oracle.jdbc.driver.OracleDriver");

Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl","text0816","666666");

out.println("连接成功!");

String sql = "select * from player where playerid=? and playerpw=?";

PreparedStatement ps = conn.prepareStatement(sql);

ps.setString(1, name);

ps.setString(2, password);

ResultSet rs = ps.executeQuery();

if(rs.next())
{
    out.print("登陆成功");
    }
else
{
    out.print("登陆失败");
    }
rs.close();
ps.close();
conn.close();
}
catch(Exception e)
{
    e.printStackTrace();}

%>
</body>
</html>

技术分享

 

 

今天晚上很郁闷,登陆界面背景显示不出来,且数据库驱动加载不上,研究许久,未曾破解,大倦,宽衣而睡。。。

 

今天晚上很郁闷

标签:else   .com   head   客户   insert   player   center   hold   rom   

原文地址:http://www.cnblogs.com/HRZJ/p/6009731.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!