老师我这个是什么问题为啥链接失败 Tue Nov 07 04:20:51 CST 2023 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. Exception in thread "main" com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet successfully received from the server was 782 milliseconds ago. The last packet sent successfully to the server was 774 milliseconds ago. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at com.mysql.jdbc.Util.handleNewInstance(Util.java:425) at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:990) at com.mysql.jdbc.ExportControlled.transformSocketToSSLSocket(ExportControlled.java:201) at com.mysql.jdbc.MysqlIO.negotiateSSLConnection(MysqlIO.java:4869) at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1656) at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1217) at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2189) at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2220) at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2015) at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:768) at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at com.mysql.jdbc.Util.handleNewInstance(Util.java:425) at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:385) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:323) at java.sql.DriverManager.getConnection(DriverManager.java:664) at java.sql.DriverManager.getConnection(DriverManager.java:247) at jdbcTest.main(jdbcTest.java:22) Caused by: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate) at sun.security.ssl.HandshakeContext.<init>(HandshakeContext.java:171) at sun.security.ssl.ClientHandshakeContext.<init>(ClientHandshakeContext.java:101) at sun.security.ssl.TransportContext.kickstart(TransportContext.java:238) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:394) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:373) at com.mysql.jdbc.ExportControlled.transformSocketToSSLSocket(ExportControlled.java:186) ... 18 more
有没有一章是专门讲这些部分名称的 根本分不清哪个是哪个 看的云里雾里的
直接写关闭ResultSet、Statement、Connection,前面的关闭Connection和Statement方法可以不再写吗?
java.io.IOException; java.io.InputStream; java.sql.Connection; java.sql.DriverManager; java.sql.SQLException; java.util.Properties; JdbcTest2 { main(String[] args) IOException, ClassNotFoundException, SQLException { Properties prop =Properties(); InputStream is= JdbcTest2..getClassLoader().getResourceAsStream(); prop.load(is); String url = prop.getProperty(); String name = prop.getProperty(); String pwd = prop.getProperty(); String drivername =prop.getProperty(); Class.(drivername); Connection connection= DriverManager.(url, name, pwd); System..println(connection); } }
老师,发下安装包,谢谢。V15200082226
老师,发一下安装包 v:z1323315121
老师,我用的mysql是以前就装好的8.0的,现在连接不了navicat
select em.LAST_NAME,em.SALARY,em.DEPARTMENT_ID from employees em
WHERE
em.SALARY IN
(SELECT
min(e.SALARY) from employees e
GROUP BY e.DEPARTMENT_ID) group by em.DEPARTMENT_ID
package com.itbaizhan; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStream; import java.sql.Connection; import java.sql.PreparedStatement; /** * blob类型操作测试类 */ public class BlobTest { /** * 向Movie表中插入数据 */ public void insertMovie(String moviename, InputStream is){ Connection connection = null; PreparedStatement ps = null; try{ //获取连接 connection = jdbcUtils.getConnection(); //获取PreparedStatement对象 ps = connection.prepareStatement("insert into movie values(default,?,?)"); //绑定参数 ps.setString(1,moviename); ps.setBlob(2,is); ps.executeUpdate(); }catch (Exception e){ e.printStackTrace(); }finally { jdbcUtils.closeResource(ps,connection); } } public static void main(String[] args) throws FileNotFoundException { BlobTest bt = new BlobTest(); //创建读取文件的IO流 InputStream is = new FileInputStream(new File("d:/1.jpg")); bt.insertMovie("战狼",is); } }
为什么我这样打出来会显示不了名字
老师,误删了root用户,要怎么处理哈?
这个配图真的不太合适。。其他课里面也会有一些很出戏的图不如不要
为什么会报错呢
感觉老师讲的第6题有点儿歧义。
这个应该是说显示每个部门#### 的名字。。。,所以应该是group by e.departmen-id;
老师您好:
自增的PrimaryKey的值可以用update语句修改吗?还没来得及安装MySQL,还没法自己测试。另外,自增的PrimaryKey如果目前表中最大值为10,删除了这条记录后再增加一条记录,新增记录的PrimaryKey的值是10还是11?谢谢老师!
非常抱歉给您带来不好的体验!为了更深入的了解您的学习情况以及遇到的问题,您可以直接拨打投诉热线:
我们将在第一时间处理好您的问题!
关于
课程分类
百战程序员微信公众号
百战程序员微信小程序
©2014-2024 百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园网站维护:百战汇智(北京)科技有限公司 京公网安备 11011402011233号 京ICP备18060230号-3 营业执照 经营许可证:京B2-20212637