2 wqybeibei wqybeibei 于 2016.04.21 11:00 提问

再往数据库中添加数据时,起初可以添加进去,之后不知道是把电脑关了还是怎么老报错,而且添加不进去了

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 app

3个回答

banrieen
banrieen   2016.04.21 18:48

网络没有连接,或是mysql没有登录!
**Establishing SSL connection without server's identity verification **
requirements SSL connection must be established by default

wqybeibei
wqybeibei 谢谢哈 同时经常报preparedstatement的异常是怎么回事呢 每次执行报错都不一样 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" java.lang.NullPointerException at com.imooc.dao.GoddessDao.addGoddess(GoddessDao.java:21) at com.imooc.action.GoddessAction.main(GoddessAction.java:27)
一年多之前 回复
wqybeibei
wqybeibei 谢谢哈 同时经常报preparedstatement的异常是怎么回事呢 每次执行报错都不一样 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" java.lang.NullPointerException at com.imooc.dao.GoddessDao.addGoddess(GoddessDao.java:21) at com.imooc.action.GoddessAction.main(GoddessAction.java:27)
一年多之前 回复
wqybeibei
wqybeibei   2016.04.22 17:33

谢谢哈 但是同时经常报preparedstatement的异常是怎么回事呢 每次执行报错都不一样 数据库应该是连接上了 Fri Apr 22 17:36:56 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.
Exception in thread "main" java.lang.NullPointerException
at com.imooc.dao.GoddessDao.addGoddess(GoddessDao.java:21)
at com.imooc.action.GoddessAction.main(GoddessAction.java:27)

banrieen
banrieen   2016.04.22 23:27

http://stackoverflow.com/questions/36756739/how-to-disable-warn-when-connecting-to-sql-database-in-java

Maybe It will help you !

example1:
**Do what it says and add useSSL=false to the connection string.?

Yupp just figured that out... Thanks though. [+]/ – Ethan Moore yesterday

**example2:

Try to use the useSSL=false in the connection string

Example:

jdbc:mysql://xxxxxxx:3306/xxxx?autoReconnect=true&useSSL=false;
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!