zoukankan      html  css  js  c++  java
  • 学生管理系统调试笔记

    一 、   数据库连接报错:

     

     

     报错信息如下:

    Fri May 06 19:56:07 CST 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

     

     

    此时的数据库连接如下:

     

    public Connection getCon() {

    try {

    Class.forName("com.mysql.jdbc.Driver");

    String url = "jdbc:mysql://127.0.0.1/medicalsystem?useUnicode=true&characterEncoding=utf-8";

    String user = "root";

    String password = "123456";

    Connection conn = DriverManager.getConnection(url, user, password);

     

    return conn;

    } catch (Exception e) {

    e.printStackTrace();

    return null;

    }

     

     

    调试:

     

    这是数据库连接的问题,虽然以上的数据库连接没有问题,但有可能某个程序就是不能运行,那么这样的话,根据报错提示,设置useSSL=false就可以了。

    s

    String url = "jdbc:mysql://127.0.0.1/medicalsystem?useUnicode=true&characterEncoding=utf-8&useSSL=false";

     

     

    二 、Date型在接受参数时,可以直接定义成String型,但是在存入数据库中时要将空的字符串设置成null,否则无法存入数据库中。

     

     

     





  • 相关阅读:
    Spring MVC(1)Spring MVC的初始化和流程以及SSM的实现
    Spring(四)Spring与数据库编程
    MyBatis(4)-- 动态SQL
    MyBatis(3)-- Mapper映射器
    MyBatis(2)-- MyBatis配置mybatis-config.xml
    MyBatis(1)-- MyBatis介绍
    计算机网络(2)-- URL、HTTP、HTTPS、HTML
    计算机网络(1)- TCP
    Shell脚本编程
    和为定值的多个数
  • 原文地址:https://www.cnblogs.com/Yasha/p/412f9024638c9820119fab58e82b68ac.html
Copyright © 2011-2022 走看看