<? xml version = "1.0" encoding = "UTF-8" ?> < beans xmlns = "http://www.springframework.org/schema/beans" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns:aop = "http://www.springframework.org/schema/aop" xmlns:tx = "http://www.springframework.org/schema/tx" xmlns:context = "http://www.springframework.org/schema/context" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> < bean name = "productActionBean" scope = "prototype" class = "com.how2java.action.ProductAction" > < property name = "pdao" ref = "pdao" /> </ bean > < bean name = "pdao" class = "com.how2java.dao.ProductDAO" > < property name = "sessionFactory" ref = "sf" /> </ bean > < bean name = "sf" class = "org.springframework.orm.hibernate3.LocalSessionFactoryBean" > < property name = "dataSource" ref = "ds" /> < property name = "mappingResources" > < list > < value >com/how2java/pojo/Product.hbm.xml</ value > </ list > </ property > < property name = "hibernateProperties" > < value > hibernate.dialect=org.hibernate.dialect.MySQLDialect hibernate.show_sql=false hbm2ddl.auto=update </ value > </ property > </ bean > < bean name = "ds" class = "org.springframework.jdbc.datasource.DriverManagerDataSource" > < property name = "driverClassName" value = "com.mysql.jdbc.Driver" /> < property name = "url" value = "jdbc:mysql://localhost:3306/how2java?characterEncoding=UTF-8" /> < property name = "username" value = "root" /> < property name = "password" value = "admin" /> </ bean > </ beans > |