連結至 Oracle
開始之前
在開始之前,請先了解如何創建資料來源
Step 1: 建立資料來源
您可以透過以下兩種操作來建立資料來源,第一種為點擊側欄 Data Source 的 “+” 按鈕,或是點擊 Overview 頁面中的 Create a Data Source 按鈕來建立。

Step 2: 設定連線資訊
在彈出的視窗表單中,填入及設定連線資訊,並點擊 Submit 送出。

Name: 資料庫名稱,供顯示使用,後續可作修改Data Source Type: 資料庫類型,請選擇OracleURL: 請填入<hostname>:<port>的格式,例如database-1.cboscstksckj.ap-northeast-1.rds.amazonaws.com:1521,10.207.64.3:1521Username: 連線使用的 UsernamePassword: 連線使用的 PasswordContent Type: 使用 SID 或是 SERVICE_NAME 連線SIDorService Name: 根據選擇的Content Type,可進一步輸入SID或是Service NameDefault Scale及Number Rounding Mode: 若 Table 中含有浮點數的型別,例如Double、Float,而資料中也有小數點的值,則需要設定這兩個欄位
Info
Table Pattern feature is only available after version 2.4.3
Table Pattern: 填入 Java regular expression 來篩選需要連接的資料表。 例如填入public.r.*,篩選出在publicschema 底下以r為開頭名稱的資料表。Explore Timeout: 若資料庫中含有的 Table 數量較大,建議調高此參數,讓 Explore 可執行較久
Default Scale 及 Number Rounding ModeDefault Scale: 小數點處理到第幾個位數Number Rounding Mode: 若超過Default Scale指定的位數,超出的部分該如何處理Unnecessary: 若超出位數,直接拋出錯誤,讓 Query 失敗Up: Round away from zeroDown: Round towards zero.Ceiling: Round towards positive infinity.Floor: Round towards negative infinity.Half Up: Round towards "nearest neighbor" unless both neighbors are equidistant, in which case round up.Half Down: Round towards "nearest neighbor" unless both neighbors are equidistant, in which case round down.Half Even: Round towards the "nearest neighbor" unless both neighbors are equidistant, in which case, round towards the even neighbor.
下列舉例碰到不同的值,在 Default Scale = 0 時,不同的 Number Rounding Mode 實際得到的值
| Input Number | UP | DOWN | CEILING | FLOOR | HALF_UP | HALF_DOWN | HALF_EVEN | UNNECESSARY |
|---|---|---|---|---|---|---|---|---|
| 5.5 | 6 | 5 | 6 | 5 | 6 | 5 | 6 | throw ArithmeticException |
| 2.5 | 3 | 2 | 3 | 2 | 3 | 2 | 2 | throw ArithmeticException |
| 1.6 | 2 | 1 | 2 | 1 | 2 | 2 | 2 | throw ArithmeticException |
| 1.1 | 2 | 1 | 2 | 1 | 1 | 1 | 1 | throw ArithmeticException |
| 1.0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| -1.0 | -1 | -1 | -1 | -1 | -1 | -1 | -1 | -1 |
| -1.1 | -2 | -1 | -1 | -2 | -1 | -1 | -1 | throw ArithmeticException |
| -1.6 | -2 | -1 | -1 | -2 | -2 | -2 | -2 | throw ArithmeticException |
| -2.5 | -3 | -2 | -2 | -3 | -3 | -2 | -2 | throw ArithmeticException |
| -5.5 | -6 | -5 | -5 | -6 | -6 | -5 | -6 | throw ArithmeticException |
Step 3: 完成建立
進行 Submit 後,稍後片刻將會在側欄中顯示 Oracle 的資料來源,點擊後可以進入此資料來源細節頁面。
