메뉴 건너뛰기

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>


번호 제목 날짜 조회 수
320 github에 있는 프로젝트와 로컬에서 작업한 프로젝트 합치기 2016.11.22 11861
319 특정 커밋 시점(commit id를 기준으로)으로 돌리기(reset) 2016.11.21 10899
318 Github를 이용하는 전체 흐름 이해하기 2016.11.18 8854
317 특정 단계의 commit상태로 만들기(이렇게 하면 중간에 반영된 모든 commit를 history가 삭제된다) 2016.11.17 11539
316 git 초기화(Windows에서 Git Bash사용) 2016.11.17 11302
315 spark notebook 0.7.0설치및 설정 2016.11.14 14943
314 참고할만한 spark예제를 설명하는 사이트 2016.11.11 15769
313 Kafka Offset Monitor로 kafka 상태 모니터링 하기 file 2016.11.08 12282
312 Eclipse실행시 Java was started but returned exit code=1이라는 오류가 발생할때 조치방법 2016.11.07 9374
311 [SparkR]SparkR 설치 사용기 1 - Installation Guide On Yarn Cluster & Mesos Cluster & Stand Alone Cluster file 2016.11.04 6533
310 데이타 분석및 머신러닝에 도움이 도움이 되는 사이트 2016.11.04 9211
309 java스레드 덤프 분석하기 file 2016.11.03 8421
308 centos 6에서 mariadb 5.1 to 10.0 으로 upgrade 2016.11.01 15232
307 Spark Streaming 코드레벨단에서의 성능개선 2016.10.31 8879
306 Flume과 Kafka를 사용한 초당 100만개 로그 수집 테스트 file 2016.10.31 11528
305 Flume을 이용한 데이타 수집시 HBase write 성능 튜닝 file 2016.10.31 9692
304 How-to: Build a Complex Event Processing App on Apache Spark and Drools file 2016.10.31 9836
303 How-to: Tune Your Apache Spark Jobs (Part 2) file 2016.10.31 11100
» mybatis와 spring을 org.apache.commons.dbcp2.BasicDataSource의 DataSource로 연동할때 DB설정(참고) 2016.10.31 11738
301 Caused by: java.sql.SQLNonTransientConnectionException: Could not read resultset: unexpected end of stream, read 0 bytes from 4 오류시 확인/조치할 내용 2016.10.31 13869
위로