GlassFish 5和MySQL连接器 [英] GlassFish 5 and MySQL Connector

查看:207
本文介绍了GlassFish 5和MySQL连接器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将GlassFish 5与mysql-connector-java-8.0.13.jar

I use GlassFish 5 with mysql-connector-java-8.0.13.jar

CLASSPATH值:

C:\Program Files\glassfish5\glassfish\lib 
C:\Program Files\glassfish5\glassfish\domains\domain1\lib 
C:\Program Files\glassfish5\glassfish\domains\domain1\lib\ext 

服务器和便携式计算机多次重启后,仍然出现此错误:

After several restarts of both the server and the laptop it still gives this error:

针对MySQL_sakila的Ping连接池失败.类名错误或未为以下项设置类路径:com.mysql.jdbc.jdbc2.optional.MysqlDataSource请检查server.log以获取更多详细信息.

Ping Connection Pool failed for MySQL_sakila. Class name is wrong or classpath is not set for : com.mysql.jdbc.jdbc2.optional.MysqlDataSource Please check the server.log for more details.

属性

问题类似于此 StackOverflow来源,但我在此处应用了答案,但都没有帮助.

The issue is similar to this StackOverflow source but I have applied the answers there and none of them have helped.

推荐答案

对我有用的东西:

Datasource Classname: com.mysql.cj.jdbc.MysqlConnectionPoolDataSource 

JDBC连接池的两个新附加属性":

Two new "Additional Properties" to the JDBC Connection Pool :

useSSL = false 
serverTimezone = UTC (this is not even true in my case, I am UTC+2) 

这里有一个注释:当我安装MySQL实例时,我明确设置了它不使用SSL页面中有关安装程序中选项的密码.

Here one remark : when I installed MySQL instance, I expressly set it NOT to use SSL for the passwords from the option in the installer on the regarding page.

其他附加属性"是:

password = myPass 
databaseName = sakila 
serverName = localhost 
user = root 
networkProtocol = jdbc 
portNumber = 3306 

..成功了

这篇关于GlassFish 5和MySQL连接器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆