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>
    

      

  • 相关阅读:
    appfabric cache配置,实验记录
    appfabric cache存储ef 查询结果的bug
    CruiseControl.NET svn获取 自动编译 ftp上传
    @Ajax.RenderAction 把局部页改为ajax加载
    分布式架构下的mvc 异步controller ajax comet 长连接
    win7重装iis,搞死
    验证码识别的基本思路及方法
    C# 获取程序当前文件夹
    在c#中 限制文本框只能输入数字
    string字符串 获取指定位置范围的子字符串
  • 原文地址:https://www.cnblogs.com/sunhongbin/p/13866047.html
Copyright © 2011-2022 走看看