메뉴 건너뛰기

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>


번호 제목 날짜 조회 수
328 ResultSet에서 데이타를 List<Map<String,String>>형태로 만들어서 리턴하는 소스(Collections.sort를 이용한 정렬 가능) 2016.12.15 2122
327 hbase startrow와 endrow를 지정하여 검색하기 샘플 2016.12.07 1003
326 jena의 data폴더를 hadoop nfs를 이용하여 HDFS상의 폴더에 마운트 시키고 fuseki를 통하여 inert를 시도했을때 transaction 오류 발생 2016.12.02 1017
325 Jena 2.3를 Hadoop 2.7.2의 NFS로 mount하고 fuseki를 이용하여 start할때 오류 메세지 2016.12.02 2508
324 S2RDF를 이용한 다른 버젼의 github링크 2016.12.02 1292
323 Mountable HDFS on CentOS 6.x(hadoop 2.7.2의 nfs기능을 이용) 2016.11.24 1873
322 원격의 origin/master를 기준으로 dev branch를 만들어 작업후 원격의 origin/dev에 push하는 방법 file 2016.11.22 1761
321 .gitignore파일에 지정되지 않은 파일이 ignore되는 경우 확인방법 2016.11.22 1773
320 github에 있는 프로젝트와 로컬에서 작업한 프로젝트 합치기 2016.11.22 1740
319 특정 커밋 시점(commit id를 기준으로)으로 돌리기(reset) 2016.11.21 1771
318 Github를 이용하는 전체 흐름 이해하기 2016.11.18 1138
317 특정 단계의 commit상태로 만들기(이렇게 하면 중간에 반영된 모든 commit를 history가 삭제된다) 2016.11.17 1771
316 git 초기화(Windows에서 Git Bash사용) 2016.11.17 1968
315 spark notebook 0.7.0설치및 설정 2016.11.14 1690
314 참고할만한 spark예제를 설명하는 사이트 2016.11.11 1372
313 Kafka Offset Monitor로 kafka 상태 모니터링 하기 file 2016.11.08 2371
312 Eclipse실행시 Java was started but returned exit code=1이라는 오류가 발생할때 조치방법 2016.11.07 1811
311 [SparkR]SparkR 설치 사용기 1 - Installation Guide On Yarn Cluster & Mesos Cluster & Stand Alone Cluster file 2016.11.04 1140
310 데이타 분석및 머신러닝에 도움이 도움이 되는 사이트 2016.11.04 1648
309 java스레드 덤프 분석하기 file 2016.11.03 943
위로