日期:2014-05-20 浏览次数:20804 次
<!-- Configure the Datasource -->
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName">
<value>sun.jdbc.odbc.JdbcOdbcDriver</value>
</property>
<property name="url">
<value>jdbc:odbc:ASE_XXX</value>
</property>
<property name="username">
<value>dba</value>
</property>
<property name="password">
<value>123456</value>
</property>
</bean>
<!-- Configure sessionFactory base on Hibernate -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource"/>
</property>
<property name="hibernateProperties">
<props>
<!-- Database Connect 方言 -->
<prop key="dialect">org.hibernate.dialect.SybaseDialect</prop>
<!-- 打印SQL语句 -->
<prop key="hibernate.show_sql">true</prop>
<!-- 格式化SQL语句 -->
<prop key="hibernate.format_sql">true</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>com/model/Product.hbm.xml</value>
</list>
</property>
</bean>