hibernate中mysql的編碼設定

<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">mysql

<hibernate-configuration>
<session-factory>
  <!--<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>-->
  <!--<property name="connection.url">jdbc:oracle:thin:@localhost:1521:hibernate_office</property>-->
  <!--<property name="connection.username">office</property>-->
  <!--<property name="connection.password">office</property>-->sql

  <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
  <property name="connection.url">jdbc:mysql://localhost:3306/mysql?useUnicode=true&amp;characterEncoding=utf8</property>
  <property name="connection.username">lpl</property>
  <property name="connection.password">xxxxx</property>
  <property name="dialect">org.hibernate.dialect.OracleDialect</property>
  <!--<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>-->
  <property name="show_sql">true</property>
  <property name="c3p0.max_size">2</property>
  <property name="c3p0.min_size">2</property>
  <property name="c3p0.timeout">5000</property>
  <property name="c3p0.max_statements">100</property>
  <property name="c3p0.idle_test_period">3000</property>
  <property name="c3p0.acquire_increment">2</property>
  <property name="myeclipse.connection.profile">office</property>session

  <mapping class="com.accp.pojo.Users" />
  <mapping class="com.accp.pojo.Email" />
  <mapping class="com.accp.pojo.Vacation" />oracle

 

</session-factory>
</hibernate-configuration>app

相關文章
相關標籤/搜索