解决此异常Table 'mvc.mvc__users' doesn't exist

不知道大家遇到这样的异常是在什么样的情况下!

昨天我使用hibernte生成Users.hbm.xml生成时没有去掉catalog属性!就发生此异常!后来把他去掉了就没问题了!

我的connection.url="jdbc:mysql://127.0.0.1:3306/mvc"

而catalog="mvc"

 

 

 

Exception in thread "main" org.hibernate.exception.SQLGrammarException: could not execute query
 at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:70)
 at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
 at org.hibernate.loader.Loader.doList(Loader.java:1596)
 at org.hibernate.loader.Loader.list(Loader.java:1577)
 at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:395)
 at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:271)
 at org.hibernate.impl.SessionImpl.list(SessionImpl.java:844)
 at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
 at com.yohn.hibernate.TEst.main(TEst.java:13)
Caused by: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 'mvc.mvc__users' doesn't exist
 at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
 at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870)
 at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)
 at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
 at com.mysql.jdbc.Connection.execSQL(Connection.java:3176)
 at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1153)
 at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1266)
 at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:120)
 at org.hibernate.loader.Loader.getResultSet(Loader.java:1272)
 at org.hibernate.loader.Loader.doQuery(Loader.java:391)
 at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:218)
 at org.hibernate.loader.Loader.doList(Loader.java:1593)
 ... 6 more
Table 'mvc.mvc__users' doesn't exist
 

 

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值