zoukankan      html  css  js  c++  java
  • 10.20号进度总结

    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
        <%@ page import="java.sql.Connection" %>
    <%@ page import="java.sql.DriverManager" %>
    <%@ page import="java.sql.SQLException" %>
    <%@ page import="java.sql.PreparedStatement" %>
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title>Insert title here</title>
    </head>
    <body>
    <%request.setCharacterEncoding("UTF-8");%>
    <jsp:useBean id="user" class="bean.table"></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 t_table(jg1,tx,dw,dz,fr,yz,lx,lg,ly,cz,qy1,gk,jg,gx,qs,jz,zd,cg,yj,xk,xq,hz,yx,ze,zze,szdy) values('"+user.getJgmc()+"','"+user.getTxdz()+"','"+user.getDwwz()+"','"+user.getDzyx()+"','"+user.getFrdb()+"','"+user.getYzbm()+"','"+user.getLxr()+"','"+user.getGddh()+"','"+user.getYddh()+"','"+user.getCz()+"','"+user.getQyjg()+"','"+user.getGkglbm()+"','"+user.getJgjj()+"','"+user.getJgxqmc()+"','"+user.getQsxqnx()+"','"+user.getJzxqnx()+"','"+user.getZdkjxqgs()+"','"+user.getGjz()+"','"+user.getYjlx()+"','"+user.getXkfl()+"','"+user.getXqjsssly()+"','"+user.getHzms()+"','"+user.getYxdw()+"','"+user.getZe()+"','"+user.getZze()+"','"+user.getSzdy()+"');";               
        		
    
                PreparedStatement ps = conn.prepareStatement(sql);
                
                int row = ps.executeUpdate();
                System.out.println(row);
                if(row>0){
                    out.println("提交成功");
                }
            }
        }catch (Exception e){
            e.printStackTrace();
            out.print("提交失败");
        }
    %>
    </body>
    </html>
    

      

  • 相关阅读:
    behavior planning——15.cost function design weightTweaking
    behavior planning——14.implement a cost function in C++
    behavior planning——13. implement a cost function in C++
    behavior planning——12.example cost funtion -lane change penalty
    发布全局项目
    http
    网址大全
    JSON.parse()和JSON.stringify()
    Ajax+Node分页
    H5移动端的注意细节
  • 原文地址:https://www.cnblogs.com/sunhongbin/p/13866047.html
Copyright © 2011-2022 走看看