数据未在Mysql数据库中提交

时间:2017-07-26 17:52:02

标签: java mysql jdbc

连接文件

const timeToPeriod = time =>
  time >= 17
    ? 'Evening'
    : time >= 12
      ? 'Afternoon'
      : 'Morning'

const greet = (name, time) =>
  `Good ${timeToPeriod(time)} ${name} !`
  
console.log(greet('Jonas', 9))  // Good Morning Jonas !
console.log(greet('Jonas', 13)) // Good Afternoon Jonas !
console.log(greet('Jonas', 22)) // Good Evening Jonas !

注册表单提交文件

package hashconnect;

import java.sql.Connection;
import java.sql.DriverManager;

public class dbconnect {
    public static Connection con;
    static {
        try {
            String user = "root";
            String password = "abcde";
            Class.forName("com.mysql.jdbc.Driver");

            String url = "jdbc:mysql://localhost:3306/hashvideos";
            con = DriverManager.getConnection(url,user,password);

            if(con!=null)
                System.out.println("Connection is ok");
            else
                System.out.println("Connection is not ok");
        }
        catch (Exception e)
        {
            System.out.println(e.getMessage());
        }
    }

}

请帮帮我,我正在提交数据但是没有提交 我已经尝试了所有东西,即使我已经卸载并再次安装相应的软件,但仍然没有纠正错误请帮助我。

0 个答案:

没有答案