Spring Hibernate Integration Sybase

Spring Hibernate Integration Sybase

Spring with Hibernate is good combination of building enterprise applicaiton where Spring will handle all application level responsibility and Hibernate will interact with the database. In this tutorial I will be using Spring 4.1.5.RELEASE which is latest version and Hibernate 4.3.9.Final which is latest version while writing this tutorial. To keep this tutorial simple we will just make one call to the Sybase data to get data.

Tools needed:

  • Sybase ASE(Adaptive Server Enterprise) 15.7
  • Eclipse
  • JDK 1.8
  • Maven 3.2

Create sample table in Sybase database:

  • Insert some sample data for test:

  • Now execute select statement to see if data inserted or not:

Spring Hibernate Integration Sybase

  • Create maven project name: SpringHibernateIntegration below is final proejct structure:

Spring Hibernate Integration Sybase

  • pom.xml:

Context files:

  • applicaiton-context.xml:

  • hibernate-context.xml:

Properties files:

  • applicaiton.properties:

  • hibernate.properties and please don’t forget to change this properties file data base configuration with yours:

  • hibernate.queries.xml to keep queries:

  • JavaHonkDao.java:

  • JavaHonkDaoHanler.java:

  • Finally write JavaHonkTestApp.java class which will load application context and will call to the database, print its output on console:

  • Now run this application you will see below output:

Spring Hibernate Integration Sybase

  • For more information please visit Spring site here

download Download Project: SpringHibernateIntegration

Leave a Reply

Your email address will not be published. Required fields are marked *