hibernate +mysql

月海 2008-04-28 08:39:12

JDBCExceptionReporter - could not execute query [select userinfo0_.USER_ID as USER1_, userinfo0_.USERNAME as USERNAME0_, userinfo0_.PASSWORD as PASSWORD0_, userinfo0_.ENABLED as ENABLED0_ from test__userinfo userinfo0_ where userinfo0_.USERNAME=?]
java.sql.SQLException: Table 'test.test__userinfo' doesn't exist
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2926)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1571)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1666)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2978)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2902)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:933)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1027)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:92)
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)
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.gg.dao.UserinfoDAO.findByProperty(UserinfoDAO.java:85)
at com.gg.dao.UserinfoDAO.findByUsername(UserinfoDAO.java:94)
at com.gg.test.Testa.main(Testa.java:19)

我的数据库是 这个样子的: 数据库是test 下面有个userinfo表,在通过hibernate 生成的查询语句时出现这样的错误 'test.test__userinfo' ,为什么找不到表?


...全文
55 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
月海 2008-04-28
  • 打赏
  • 举报
回复
mysql驱动是 mysql-connector-java-3.1.11-bin.jar
月海 2008-04-28
  • 打赏
  • 举报
回复
我使用的mysql 是5.0 hibernate 是 3.1 使用Eclipse 3.2 开发

56,687

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧