Home >Database >Mysql Tutorial >getHibernateTemplate().save();不能保存数据到数据库解决办法

getHibernateTemplate().save();不能保存数据到数据库解决办法

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 15:10:501621browse

在hibernate的配置文件hibernate.cfg.xml中 ?xml version='1.0' encoding='UTF-8'? !DOCTYPE hibernate-configuration PUBLIC -//Hibernate/Hibernate Configuration DTD 3.0//EN http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd !-- Gen

在hibernate的配置文件hibernate.cfg.xml中


br>           "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
          "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">




    
        
            org.hibernate.dialect.MySQLDialect
        

        
            jdbc:mysql://127.0.0.1:3306/abc
        

        root
        root
        
            com.mysql.jdbc.Driver
        

        true
        kucun
        
        
        
        
        
        
        
        
        
        
        
        

    


把的属性connection.autocommit设置为true就ok了


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn