Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java IDE » Eclipse  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 求助!!eclipse下用hibernate连数据库的错误。
gen_fossil





发贴: 1
积分: 0
于 2006-11-22 17:21 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
数据库: mysql,
jdbc驱动文件mysql-connector-java-5.0.3-bin.jar,
driver-class:org.gjt.mm.mysql.Driver
url: jdbc:mysql://localhost:3306/test
dialect: mysql

在eclipse下能够看见数据库及表的内容。
写了个test类: 以下是 main()中的所有代码:
Session session = null;
try{
Configuration config = new Configuration().configure();
SessionFactory sessionFactory = config.buildSessionFactory();
session = sessionFactory.openSession();
    
}catch(HibernateException e){
e.printStackTrace();
}

运行出现异常:
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
org.hibernate.MappingException: could not instantiate id generator
  at org.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGeneratorFactory.java:92)
  at org.hibernate.mapping.SimpleValue.createIdentifierGenerator(SimpleValue.java:151)
  at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:178)
  at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1005)
  at Test.main(Test.java:23)
Caused by: org.hibernate.MappingException: Dialect does not support sequences
  at org.hibernate.dialect.Dialect.getSequenceNextValString(Dialect.java:430)
  at org.hibernate.id.SequenceGenerator.configure(SequenceGenerator.java:65)
  at org.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGeneratorFactory.java:88)
  ... 4 more

弄了很长时间不知道怎么办,请大人请教,万分感谢。


gen_fossil edited on 2006-11-23 09:51


话题树型展开
人气 标题 作者 字数 发贴时间
9969 求助!!eclipse下用hibernate连数据库的错误。 gen_fossil 1555 2006-11-22 17:21

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923