All you need to do is to config the following 2 beans in your spring config file.
<!-- Hibernate configuration -->
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
destroy-method="close">
<property name="driverClass" value="com.sybase.jdbc2.jdbc.SybDataSource"/>
<property name="jdbcUrl" value="jdbc:sybase:Tds:hkeqrmsu1.ap.ssmb.com:4100/DRMS"/>
<property name="user" value="eqjobs"/>
<property name="password" value="jobs99"/>
<property name="minPoolSize" value="2"/>
<property name="acquireIncrement" value="1"/>
<property name="maxPoolSize" value="20"/>
<property name="idleConnectionTestPeriod" value="3000"/>
<property name="maxStatements" value="100"/>
</bean>
<bean id="hibernateSessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="mappingLocations" value="classpath*:hibernate/mappingResources/*.hbm.xml"/>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.SybaseDialect</prop>
<prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop>
</props>
</property>
</bean>
1) Basically, Hibernate is an O/R mapping tool. So, the most important bean should be a datasource. Alternatively, you can config your bean in another way, using JNDI.
<bean id="dataSource1" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>java:comp/env/jdbc/trainingDatasource</value>
</property>
</bean>
2) If you use Hibernate alone, definitely, you need to supply a Hibernate config file – hibernate.properties which looks like this:
hibernate.query.substitutions yes 'Y', no 'N'
hibernate.connection.pool_size 1
hibernate.proxool.pool_alias pool1
hibernate.show_sql true
hibernate.format_sql true
hibernate.max_fetch_depth 1
hibernate.jdbc.batch_versioned_data true
hibernate.jdbc.use_streams_for_binary true
hibernate.cache.region_prefix hibernate.test
hibernate.cache.use_second_level_cache true
hibernate.cache.use_query_cache true
hibernate.cache.provider_class org.hibernate.cache.EhCacheProvider
When integrated with Spring together, there is no need to supply this config file. You can just put everything into the hibernateProperties property in hibernateSessionFactory