zoukankan      html  css  js  c++  java
  • 10.21日进度报告

    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <%@ page import="java.sql.Connection" %>
    <%@ page import="java.sql.DriverManager" %>
    <%@ page import="java.sql.SQLException" %>
    <%@ page import="java.sql.PreparedStatement" %>
    <html>
    <head>
        <title>添加结果</title>
        <style type="text/css">
            body{
                background: #d7c7e9;
                align-content: center;
                text-align: center;
            }
        </style>
    </head>
    <body>
    <%request.setCharacterEncoding("UTF-8");%>
    <jsp:useBean id="user" class="bean.Users"></jsp:useBean>
    <jsp:setProperty name="user" property="*"/>
    <%
        Connection conn =null;
        try{
            try {
                Class.forName("com.mysql.jdbc.Driver");
            } catch (ClassNotFoundException e) {
                e.printStackTrace();
                out.print("驱动器加载失败");
            }
            String url = "jdbc:mysql://localhost:3306/test?useSSL=false&serverTimezone=UTC&characterEncoding=UTF-8";
            String username = "root";
            String password = "123456";
            try{
                conn = DriverManager.getConnection(url,username,password);
            }catch (SQLException e){
                out.println(e.getMessage());
                out.println("数据库连接失败");
            }
            if(conn != null){
                String sql = "insert into user(username,password,xingming,xingbie,sheng,city,gongzuodanwei,zhuanyefangxiang,hangye,jiaoyu,zhicheng,tongxun,youzheng,shouji,gudingdianhua,qq,msn,power,zhenghao)values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
                PreparedStatement ps = conn.prepareStatement(sql);
                ps.setString(1,user.getUsername());
                ps.setString(2,user.getPassword());
                ps.setString(3,user.getXingming());
                ps.setString(4,user.getXingbie());
                ps.setString(5,user.getSheng());
                ps.setString(6,user.getCity());
                ps.setString(7,user.getGongzuodanwei());
                ps.setString(8,user.getZhuanyefangxiang());
                ps.setString(9,user.getHangye());
                ps.setString(10,user.getJiaoyu());
                ps.setString(11,user.getZhicheng());
                ps.setString(12,user.getTongxun());
                ps.setString(13,user.getYouzheng());
                ps.setString(14,user.getShouji());
                ps.setString(15,user.getGudingdianhua());
                ps.setString(16,user.getQq());
                ps.setString(17,user.getMsn());
                ps.setInt(18,user.getPower());
                ps.setString(19,user.getZhenghao());
                int row = ps.executeUpdate();
                if(row>0){
                    out.println("注册成功");
                }
            }
        }catch (Exception e){
            e.printStackTrace();
            out.print("注册失败");
        }
    %>
    <br>
    <a href="denglu.jsp">返回</a>
    </body>
    </html>
    

      对于hbase的测试使用

  • 相关阅读:
    常见的消息队列中间件介绍
    关系型数据库和非关系型数据库区别、oracle与mysql的区别
    SQL Server 和 Oracle 以及 MySQL 数据库
    Redis,Memcache,MongoDb的特点与区别
    详解布隆过滤器的原理,使用场景和注意事项
    Redis缓存穿透、缓存击穿以及缓存雪崩
    RPC、HTTP、RESTful
    集群,分布式,微服务概念和区别理解
    电脑双屏变单屏后,界面显示问题
    JDK 15已发布,你所要知道的都在这里!
  • 原文地址:https://www.cnblogs.com/sunhongbin/p/13866053.html
Copyright © 2011-2022 走看看