Home > Database > Mysql Tutorial > body text

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

WBOY
Release: 2016-06-07 15:10:50
Original
1580 people have browsed it

在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了


Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template