hibernate3到底跟hibernate4有什么区别
spmsv 2012-04-10 03:50:18 前面的贴子也没人能解决问题,相同的代码在hibernate3和hibernate4结果不一样,一个成功了,一个则报错!
这是hibernate4.1.2的结果
ERROR: HHH000231: Schema export unsuccessful
java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/hibernate
at java.sql.DriverManager.getConnection(DriverManager.java:602)
at java.sql.DriverManager.getConnection(DriverManager.java:154)
at org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl.getConnection(DriverManagerConnectionProviderImpl.java:192)
at org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:55)
at org.hibernate.tool.hbm2ddl.DatabaseExporter.<init>(DatabaseExporter.java:52)
at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:367)
at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:304)
at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:293)
at Create.main(Create.java:12)
这是hibernate3的结果
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
drop table if exists news_table
create table news_table (
id integer not null auto_increment,
title varchar(255),
content varchar(255),
primary key (id)
)
代码和xml文件都没变,只是更换了hibernate3和4的jar包,麻烦大家帮忙解决下,要我这里的源码的留下邮箱