메뉴 건너뛰기

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>


번호 제목 날짜 조회 수
390 [shell script] 파일을 한줄씩 읽어서 파일내용으로 명령문 만들고 실행하는 shell script예제 2017.02.21 3859
389 [shell script]test.txt에 space로 분리된 내용을 일어들이는 예제 2017.02.21 3240
388 spark에서 hive table을 읽어 출력하는 예제 소스 2017.03.09 3791
387 spark에서 hive table을 읽어 출력하는 예제 소스 2017.03.09 4847
386 spark2.0.0에서 hive 2.0.1 table을 읽어 출력하는 예제 소스(HiveContext, SparkSession, SQLContext) 2017.03.09 3254
385 It is indirectly referenced from required .class files 오류 발생시 조치방법 2017.03.09 4176
384 spark 2.0.0의 api를 이용하는 예제 프로그램 2017.03.15 3108
383 kafka-manager 1.3.3.4 설정및 실행하기 2017.03.20 4977
382 nc -l 7777 : 7777포트에서 입력을 받는다. 2017.03.23 3320
381 JavaStreamingContext를 이용하여 스트림으로 들어오는 문자열 카운트 소스 2017.03.30 2551
380 [메모리 덤프파일 분석] 2017.03.31 2242
379 streaming작업시 입력된 값에 대한 사본을 만들게 되는데 이것이 실패했을때 발생하는 경고메세지 2017.04.03 3841
378 protege 설명및 사용법 file 2017.04.04 6126
377 Container killed by the ApplicationMaster. Container killed on request. Exit code is 143 Container exited with a non-zero exit code 143 TaskAttempt killed because it ran on unusable node 오류시 조치방법 2017.04.06 3895
376 LUBM 개수별 hadoop HDFS data사이즈 정리 2017.04.06 2413
375 update를 많이 하면 heap memory가 많이 소진되고 최종적으로 OOM가 발생하는데 이에 대한 설명 2017.04.10 3611
374 [jsoup]Jsoup Tutorial 2017.04.11 3103
373 [Jsoup]특정페이지를 jsoup을 이용하여 파싱하는 샘플소스 2017.04.18 4029
372 Caused by: java.lang.ClassNotFoundException: org.apache.spark.Logging 발생시 조치사항 2017.04.19 3752
371 Spark에서 Serializable관련 오류및 조치사항 2017.04.21 7743
위로