Você está na página 1de 2

<?xml version='1.0' encoding='UTF-8' ?

>
<!-- was: <?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:context="http://www.springframework.org/schema/context"

xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-4.0.xsd">

<context:annotation-config/>
<tx:annotation-driven transaction-manager="transactionManagar"/>
<context:component-scan base-package="Servicios"/>

<!--Base de Datos POSTGRESQL-->


<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriveManagerDataSource">
<property name="driveClassName" value="org.postgres.Drive"/>
<property name="url" value="jdbc:postgresql://127.0.0.1/db_ventas"/>
<property name="username" value="postgres"/>
<property name="password" value="qwerty"/>
</bean>

<!--Persistencia de datos MyBatis-->

<bean id="sqlSessionFactory"
class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="configLocation" ref="/WEB-INF/configuracion-xml"/>

</bean>
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" ref="Mapeadores">

</bean>

<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
<!--bean id="propertyConfigurer"

class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
p:location="/WEB-INF/jdbc.properties" />

<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource"
p:driverClassName="${jdbc.driverClassName}"
p:url="${jdbc.url}"
p:username="${jdbc.username}"
p:password="${jdbc.password}" /-->

<!-- ADD PERSISTENCE SUPPORT HERE (jpa, hibernate, etc) -->

</beans>

Você também pode gostar