没有连接可用错误时,必须设置'hibernate.dialect' [英] 'hibernate.dialect' must be set when no Connection available error

查看:147
本文介绍了没有连接可用错误时,必须设置'hibernate.dialect'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Hibernate时出现以下错误:

I am getting the following error when using Hibernate:

当没有连接时,必须设置'hibernate.dialect'

我正在使用数据源进行数据库连接。

And I am using a datasource for database connection.

推荐答案

问题可能是您没有为要连接的数据库安装客户端库。

The issue could be that you haven't installed the client library for the database you are trying to connect to.

我有一个没有的Spring应用程序一个persistence.xml文件,因此没有hibernate.dialect声明。

I have a Spring application that does not have a persistence.xml file and therefore no hibernate.dialect declaration.

一旦我安装了 MySQL Connector / J 客户端库错误消失了。

Once I installed the MySQL Connector/J client library the error went away.

编辑:我也得到了这个错误数据库服务器未运行时。现在经常发生的事情是我通过MAMP运行我的MySQL服务器。

I've also gotten this error when the database server wasn't running. Something that often happens now that I run my MySQL server through MAMP.

这篇关于没有连接可用错误时,必须设置'hibernate.dialect'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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