首页  :: 新随笔  :: 管理

portlet 使用spring jdbcTemplate

Posted on 2011-07-25 00:39  季枫  阅读(390)  评论(0编辑  收藏  举报

<?xml version="1.0" encoding="UTF-8"?>
<beans
    
xmlns="http://www.springframework.org/schema/beans"
    xmlns:aop
="http://www.springframework.org/schema/aop"
    xmlns:context
="http://www.springframework.org/schema/context"
    xmlns:tx
="http://www.springframework.org/schema/tx"
    xmlns:xsi
="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation
="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
    
    
<!-- 配置使用注解 -->
    
<context:annotation-config />
    
<!-- -->
    
<bean id="liferayDataSource" class="org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy">
        
<property name="targetDataSource">
            
<bean class="com.liferay.portal.kernel.util.InfrastructureUtil" factory-method="getDataSource" />
        
</property>
    
</bean>
    
    
<bean id="jdbcTemplate"  class="org.springframework.jdbc.core.JdbcTemplate"> 
        
<property name="dataSource"><ref bean="liferayDataSource"/></property> 
    
</bean> 

    
     
<bean id="computerEntryService" class="cn.net.comsys.portlet.ShowNew.service.impl.ComputerEntryServiceImpl"/>
</beans>
智读 | 成都会领科技有限公司官网 | 智读App下载 | 每天听本书的博客 | |