메뉴 건너뛰기

Cloudera, BigData, Semantic IoT, Hadoop, NoSQL

Cloudera CDH/CDP 및 Hadoop EcoSystem, Semantic IoT등의 개발/운영 기술을 정리합니다. gooper@gooper.com로 문의 주세요.


* 참고 : http://iloveulhj.github.io/posts/java/java-commonsDBCP.html



-----------------------------DB설정 부분 -----------------------------

<?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: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.xsd

http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd

http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

    

    <bean id="dataSourceSpied" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close" >

        <property name="driverClassName" value="org.mariadb.jdbc.Driver"/>

        <property name="url" value="jdbc:mariadb://db1:3306/sda"/>

        <property name="username" value="계정명"/>

        <property name="password" value="패스워드"/> 

        <property name="maxTotal" value="30" />

        <property name="maxIdle" value="20" />

        <property name="maxWaitMillis" value="-1" />

        <property name="validationQuery" value="select 1" />

        <property name="testOnBorrow" value="false" />

        <property name="testWhileIdle" value="true" />

        <property name="maxOpenPreparedStatements" value="10" />

        <property name="poolPreparedStatements" value="true" />

    </bean>

    

    <bean id="dataSource" class="net.sf.log4jdbc.Log4jdbcProxyDataSource">

        <constructor-arg ref="dataSourceSpied" />

        <property name="logFormatter">

            <bean class="net.sf.log4jdbc.tools.Log4JdbcCustomFormatter">

                <property name="loggingType" value="MULTI_LINE" />

                <property name="sqlPrefix" value="SQL         :  "/>

            </bean>

        </property>

    </bean>

    

    

<tx:annotation-driven transaction-manager="transactionManager" />

<bean id="transactionManager"

class="org.springframework.jdbc.datasource.DataSourceTransactionManager">

<property name="dataSource" ref="dataSource"></property>

</bean>

   

</beans>


번호 제목 날짜 조회 수
316 git 초기화(Windows에서 Git Bash사용) 2016.11.17 4483
315 spark notebook 0.7.0설치및 설정 2016.11.14 3683
314 참고할만한 spark예제를 설명하는 사이트 2016.11.11 3485
313 Kafka Offset Monitor로 kafka 상태 모니터링 하기 file 2016.11.08 4889
312 Eclipse실행시 Java was started but returned exit code=1이라는 오류가 발생할때 조치방법 2016.11.07 3542
311 [SparkR]SparkR 설치 사용기 1 - Installation Guide On Yarn Cluster & Mesos Cluster & Stand Alone Cluster file 2016.11.04 2953
310 데이타 분석및 머신러닝에 도움이 도움이 되는 사이트 2016.11.04 3525
309 java스레드 덤프 분석하기 file 2016.11.03 2239
308 centos 6에서 mariadb 5.1 to 10.0 으로 upgrade 2016.11.01 3503
307 Spark Streaming 코드레벨단에서의 성능개선 2016.10.31 3269
306 Flume과 Kafka를 사용한 초당 100만개 로그 수집 테스트 file 2016.10.31 4452
305 Flume을 이용한 데이타 수집시 HBase write 성능 튜닝 file 2016.10.31 3198
304 How-to: Build a Complex Event Processing App on Apache Spark and Drools file 2016.10.31 3019
303 How-to: Tune Your Apache Spark Jobs (Part 2) file 2016.10.31 3982
» mybatis와 spring을 org.apache.commons.dbcp2.BasicDataSource의 DataSource로 연동할때 DB설정(참고) 2016.10.31 4528
301 Caused by: java.sql.SQLNonTransientConnectionException: Could not read resultset: unexpected end of stream, read 0 bytes from 4 오류시 확인/조치할 내용 2016.10.31 7423
300 VisualVM 1.3.9을 이용한 spark-submit JVM 모니터링을 위한 설정및 spark-submit실행 옵션 2016.10.28 5193
299 VisualVM 1.3.9을 이용한 JVM 모니터링 file 2016.10.27 3525
298 운영중인 상태에서 kafka topic삭제하고 재생성하여 처리되지 않은 메세지 모두 삭제하기 2016.10.24 4361
297 producer / consumer구현시 설정 옵션 설명 2016.10.19 4066
위로