본문 바로가기

Spotfire

[Spotfire] Exasol DB 연결하기 : JDBC

spotfire에 기본 데이터베이스 연결에는 Exasol이 없다.

Exasol JDBC driver를 다운로드해서 Exasol 데이터 커넥트 추가하는 방법이다.

이 방법은 spotfire sever를 통해 Exasol에 연결하기 때문에, 인포메이션 링크를 사용할 수 있다.

 

 ※ JDBC란?

Java DataBase Connectivity의 약자로, 자바 기반의 프로그램이 DB와 통신하기 위해 사용하는 JAVA API

 


 

1. Exasol JDBC 드라이버 다운로드

아래 사이트를 통해 드라이버 다운로드 포털로 이동하여 다운로드 받는다. 

https://docs.exasol.com/db/latest/connect_exasol/drivers/jdbc.htm

 

JDBC | Exasol DB Documentation

To help us understand your feedback, please check the box in the feedback form to automatically include the URL to this page.

docs.exasol.com

 

Exasol JDBC Driver

글 중간에 Exasol Download Portal. 초록색 글씨 클릭

윈도우용으로 받는다. 

Exasol JDBC driver download

 

아래와 같이 뜨는데, 한번 해준다.

 

cmd창 켜서 아래 문구 입력한다. 

certutil -hashfile [file location] SHA256

 

[file location]은 파일 위치에 다운로드된 파일 우클릭 > 경로로 복사 한 후 그대로 복붙하면 된다.

 

2. Spotfire Server 셋팅

1) 다운로드한 JDBC 드라이버 파일을 실행시켜,  

Spotfire Server 설치 위치\tomcat\webapps\spotfire\WEB-INF\lib 폴더에 설치한다.

 

 

2) Spotfire server 재시작(jar 인식시키는 과정)

 

3) Configure TIBCO Spotfire Server 에서  JDBC 셋팅[Configuration] -[Data Source Templates]클릭사전에 정의된 data source template이 많음.

여기서 data source는 [Information Designer]에서 쓰임

하단 [New]버튼 클릭

Configure TIBCO Spotfire Server

 

 아래의 XML 붙여넣고, [OK]클릭

<jdbc-type-settings>
    <type-name>EXASOL</type-name>
    <driver>com.exasol.jdbc.EXADriver</driver>
    <connection-url-pattern>
        jdbc:exa:&lt;host&gt;:&lt;port&gt;;clientname=Spotfire;
    </connection-url-pattern>
    <ping-command>SELECT 1</ping-command>
    <supports-catalogs>false</supports-catalogs>
    <supports-schemas>true</supports-schemas>
    <java-to-sql-type-conversions>
        <type-mapping>
            <from max-length="2000000">String</from>
            <to>VARCHAR($$value$$)</to>
        </type-mapping>
        <type-mapping>
            <from>Integer</from>
            <to>DECIMAL(18,0)</to>
        </type-mapping>
        <type-mapping>
            <from>Long</from>
            <to>DECIMAL(36,0)</to>
        </type-mapping>
        <type-mapping>
            <from>Float</from>
            <to>REAL</to>
        </type-mapping>
        <type-mapping>
            <from>Double</from>
            <to>DOUBLE PRECISION</to>
        </type-mapping>
        <type-mapping>
            <from>Date</from>
            <to>DATE</to>
        </type-mapping>
        <type-mapping>
            <from>DateTime</from>
            <to>TIMESTAMP</to>
        </type-mapping>
    </java-to-sql-type-conversions>
</jdbc-type-settings>

 

※ JDBC Data Source Template 확인하는 사이트

https://community.spotfire.com/articles/spotfire/spotfire-jdbc-data-access-connectivity-details/

 

Spotfire® JDBC Data Access Connectivity Details

Spotfire® connects to virtually any JDBC compliant data source via the Spotfire Server Information Services interface. Spotfire Information Services requires a Data Source Template to configure the URL Connection string, the JDBC driver class, and other s

community.spotfire.com

 

아래 이미지처럼 Exasol XML Parsed OK가 뜨면, [Save Configuration]클릭하여 설정을 저장한다.

Data Source templates

 

4) Spotfire Server 재시작(수정한 config  반영)

 

3. Spotfire Analyst에서 확인

1) Spotfire Analyst에서 설치한 서버로 접속

 

2) [Information Designer] - [New] - Data Source클릭

Name에 데이터 소스명 입력

Conection URL에 <host>:<port> 를 접속할 DB 로 변경

username, password도 넣고 [Save]클릭해서 저장한다.

Information Deigner

 

※ java.io.IOException: TLS connection to host (.....) failed: PKIX path building failed: 이런 에러가 뜨면

커넥션 스트링에 문구 추가

jdbc:exa:dev.openankus.org:8563;clientname=Spotfire;validateservercertificate=0;

 

3) Data source 연결 확인

여기에서 테이블을 Information Link로 만들어서 이용하면 된다.

 


Spotfire에서 Exasol DB 연결 방법 2가지(ODBC, JDBC)가 있다.

두 방식의 큰 차이점은 다음과 같다.

ODBC는 DB 에 직접 연결하는 방식(Spotfire Server 필요 없음)
JDBC는 Spotfire Server를 통해  DB에 연결하는 방식(인포메이션 링크)

 

상황에 맞게 DB에 연결하면 된다!