arron

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  0 随笔 :: 6 文章 :: 0 评论 :: 0 Trackbacks
我用的是mysql数据库
hibernate.properties 配置
hibernate.dialect org.hinernate.dialect.MySQLDialect
hibernate.connection.driver_class org.git.mm.mysql.Driver
hibernate.connection.driver_class com.mysql.jdbc.Driver
hibernate.connection.url jdbc:mysql://localhost/DB1
hibernate.connection.username root
hibernate.connection.password 123456
相应的hibernate.cxf.xml配置
 1 <?xml version="1.0" encoding="UTF-8"?>
 2 <!DOCTYPE hibernate-configuration PUBLIC
 3 "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
 4 "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
 5 
 6 <hibernate-configuration>
 7 
 8 <session-factory>
 9 
10 
11 <property name="show_sql">true</property>
12 
13 <!-- mysql dialect-->
14 
15 <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
16 
17 <!-- 一次读的数据库记录数 -->
18 
19 <property name="jdbc.fetch_size">50</property>
20 
21 <!-- 设定对数据库进行批量删除 -->
22         <property name="jdbc.batch_size">30</property>
23 
24 
25 <!-- resource configure -->
26 
27 <property name="hibernate.connection.url">jdbc:mysql://localhost/db1</property>
28 <property name="hibernate.connection.username">root</property>
29 <property name="hibernate.connection.password">123456</property>
30 <!-- JDBC Driver-->
31 
32 <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
33 
34 <!--是否使用数据库外连接  -->
35 <property name="hibernate.user_outer_join">true</property>
36 <!-- transaction manager -->
37 <property name="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
38 
39 <mapping resource="com/arron/domain/Tuser.hbm.xml"/>
40 <mapping resource="com/arron/domain/DynamicTuser.hbm.xml"/>
41     </session-factory>
42 </hibernate-configuration>
posted on 2009-09-09 16:54 日月龙湘 阅读(492) 评论(0)  编辑  收藏 所属分类: Hibernate

只有注册用户登录后才能发表评论。


网站导航: