org.hibernate.exception.SQLGrammarException: Error calling Driver#connect
2019独角兽企业重金招聘Python工程师标准>>>
1.hibernate报错
org.hibernate.exception.SQLGrammarException: Error calling Driver#connect
at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:123)
at org.hibernate.engine.jdbc.connections.internal.BasicConnectionCreator$1$1.convert(BasicConnectionCreator.java:118)
at org.hibernate.engine.jdbc.connections.internal.BasicConnectionCreator.convertSqlException(BasicConnectionCreator.java:140)
at org.hibernate.engine.jdbc.connections.internal.DriverConnectionCreator.makeConnection(DriverConnectionCreator.java:58)
at org.hibernate.engine.jdbc.connections.internal.BasicConnectionCreator.createConnection(BasicConnectionCreator.java:75)
at org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl.configure(DriverManagerConnectionProviderImpl.java:106)
at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:111)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:234)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206)
at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.buildJdbcConnectionAccess(JdbcServicesImpl.java:260)
at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:94)
at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:111)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:234)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206)
at org.hibernate.cfg.Configuration.buildTypeRegistrations(Configuration.java:1887)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1845)
at com.huangliusong.test.HibernateTest.init(HibernateTest.java:33)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.sql.SQLException: Unknown database 'hls_sql'
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2975)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:798)
at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3700)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1203)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2572)
at com.mysql.jdbc.Connection.<init>(Connection.java:1485)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
at org.hibernate.engine.jdbc.connections.internal.DriverConnectionCreator.makeConnection(DriverConnectionCreator.java:55)
... 37 more
java.lang.NullPointerException
at com.huangliusong.test.HibernateTest.destory(HibernateTest.java:41)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
2.截图
解决:配置文件中没有需要的数据库hls_hql
<property name="connection.url">jdbc:mysql://localhost:3306/hls_hql</property>
转载于:https://my.oschina.net/liusonghuang/blog/815574
org.hibernate.exception.SQLGrammarException: Error calling Driver#connect相关推荐
- **org.hibernate.exception.SQLGrammarException:Unknown column:XXXXX**
org.hibernate.exception.SQLGrammarException:Unknown column:XXXXX 这种情况一般是实体里面的字段与数据库里面表的字段没有对应上所造成的. ...
- 报错,could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarExc
1.问题 { "timestamp": "2020-11-28 11:18:17", "status": 404, ...
- threw exception [Request processing failed; nested exception is org.hibernate.exception.SQLGrammarE
在这里插入代码片> threw exception [Request processing failed; > nested exception is org.hibernate.exce ...
- 关于使用QAxObject类操作Excel中出现QAxBase : Error calling IDispatch member SaveAs:Exception thrown by server解决
前段时间在使用QAxObject对数据库文件导出为Excel中遇到了QAxBase : Error calling IDispatch member SaveAs:Exception thrown b ...
- org.hibernate.exception.JDBCConnectionException: could not execute query
最近在做一个项目,测试的时候是没有问题的,但是放到服务器上以后,第二天就会出现下面的异常.重启Tomcat服务器后就正常了,但是下一天还是会出现同样的异常..... 我就查了一些资料最终把问题给解决了 ...
- kettle 连接数据库报错 (错误连接数据库 [mysql] : org.pentaho.di.core.exception.KettleDatabaseException: Error occ)
文章目录 问题描述 问题分析 问题解决 测试连接 问题描述 说的是没有发现org.gjt.mm.mysql.Driver驱动,故而我们下载自己mysql对应的版本. 错误连接数据库 [mysql] : ...
- CAS (10) —— JBoss EAP 6.4下部署CAS时出现错误exception.message=Error decoding flow execution的解决办法...
CAS (10) -- JBoss EAP 6.4下部署CAS时出现错误exception.message=Error decoding flow execution的解决办法 jboss版本: jb ...
- javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not prep
2019独角兽企业重金招聘Python工程师标准>>> javax.persistence.PersistenceException: org.hibernate.exception ...
- Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.Gener
今天整合ssh 项目遇到的错误: ERROR SqlExceptionHelper Cannot create PoolableConnectionFactory (Access denied for ...
最新文章
- MATLAB神经网络样本数量太大,MATLAB搭建bp神经网络的误差特别大,但R2的值也大,求解帮我看看我的网络哪里出问题了...
- 以下哪一个不属于python语言的特点-以下不属于python语言特点的是( )_学小易找答案...
- OpenCV边缘检测专题
- Javascript调用OCX控件
- “AI+”农业向农民致敬-丰收节交易会:谋定工业反哺农业
- map操作;时间排序;repository.existsById(pid);
- 晒晒女儿学国画一学期的成果
- python网络爬虫与信息提取 学习笔记day3
- 【转】.net框架读书笔记---CLR内存管理\垃圾收集(一)
- java窗体与Flash交互
- 类的继承查询策略:广度优先
- CentOS查看硬件情况
- 好学易懂 从零开始的插头DP(一)
- 数字电路与系统(第三版)答案 戚金清 王兢
- acm:C语言程序设计:求圆柱的体积等,去除小数点后两位最后一位的四舍五入
- github下载慢的两种解决方式
- matlab 提取文件路径名称 带后缀与不带后缀
- 搭建以图搜图检索系统
- 模电设计学习笔记(二)——反相放大电路
- 机器学习数学知识(一) 自然数e