hibernate.cfg.xml配置如下
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.url">
<![CDATA[
jdbc:mysql://localhost:3306/test
]]>
</property>
<property name="hibernate.connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password" />
<!-- property name="hibernate.connection.pool_size"></property -->
<!-- dialect for MySQL -->
<property name="dialect">
net.sf.hibernate.dialect.MySQLDialect
</property>
<property name="hibernate.show_sql">true</property>
<mapping resource="Cat.hbm.xml"/>
</session-factory>
</hibernate-configuration>
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.url">
<![CDATA[
jdbc:mysql://localhost:3306/test
]]>
</property>
<property name="hibernate.connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password" />
<!-- property name="hibernate.connection.pool_size"></property -->
<!-- dialect for MySQL -->
<property name="dialect">
net.sf.hibernate.dialect.MySQLDialect
</property>
<property name="hibernate.show_sql">true</property>
<mapping resource="Cat.hbm.xml"/>
</session-factory>
</hibernate-configuration>
解决方案 »
- getOutputStream() has already been called for this response
- 这个面试题是不是太难了,咋那么多人答不上来
- Class.forName("A",true,s.class.getClassLoader());请问一下
- struts+jasperreport的问题
- [在线]poi中怎样处理xls中的空值
- 问题:多条记录查询显示
- 软件设计师和软件工程师哪个更有用?对java程序员
- hibernate list中的顺序问题
- 新手,请问服务器平台用weblogic,那么开发工具用什么比较好?
- JBoss,SyBase,CMP问题
- 如何在weblogic8下配置一个jms消息用于接收客户端消息
- JBoss配置CMP关联的问题
darkula(流浪街头的呆子)
什么叫瞎指挥?
这种情况我也遇到过,请你用词恰当点好不好!我开始就是这个错误,一摸一样的错误,你不要瞎评论好不好,如果我说的不对你也可以不用理!