hibernate.cfg.xml:
<?xml version= "1.0 " encoding= "utf-8 "?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN "
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd ">
<hibernate-configuration>
<session-factory >
<!-- local connection properties -->
<property name= "hibernate.connection.url "> jdbc:postgresql://localhost/ </property>
<property name= "hibernate.connection.driver_class "> org.postgresql.Driver </property>
<property name= "hibernate.connection.username "> postgres </property>
<property name= "hibernate.connection.password "> 1234 </property>
<!-- property name= "hibernate.connection.pool_size "> </property -->
<!-- dialect for PostgreSQL -->
<property name= "dialect "> org.hibernate.dialect.PostgreSQLDialect </property>
<property name= "hibernate.show_sql "> false </property>
<property name= "hibernate.use_outer_join "> true </property>
<mapping resource= "freeunite/hibernate/ProductMst.hbm.xml " />
<mapping resource= "freeunite/hibernate/User.hbm.xml " />
</session-factory>
</hibernate-configuration>
applicationContext.xml :
<?xml version= "1.0 " encoding= "UTF-8 "?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN " "http://www.springframework.org/dtd/spring-beans.dtd ">
<beans>
<bean id= "dataSource " class= "org.apache.commons.dbcp.BasicDataSource ">
<property name= "driverClassName ">
<value> org.postgresql.Driver </value>
</property>
<property name= "url ">
<value> jdbc:postgresql://localhost:8080/ </value>
</property>
<property name= "username ">
<value> postgres </value>
</property>
<property name= "password ">
<value> 1234 </value>
</property>
</bean>
<bean id= "sessionFactory " class= "org.springframework.orm.hibernate3.LocalSessionFactoryBean ">
<property name= "dataSource " ref= "dataSource " />
<property name= "configLocation ">
<value> classpath:hibernate.cfg.xml </value>
</property>
</bean>
<bean id= "userDao " class= "freeunite.dao.UserDAOImpl ">
<property name= "user ">
<ref bean= "sessionFactory " />