連結至 Oracle
開始之前
在開始之前,請先了解如何創建資料來源
Step1: 至 Data Sources 頁面
請點擊側欄的 Data Sources 至資料來源設定頁面

Step2: 創建資料來源
點擊右上方的 Create a Data Source,設定以下資訊在彈出表單中
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,而資料中也有小數點的值,則需要設定這兩個欄位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 |

Submit 後,稍後片刻會跳回列表頁面,並可看到 Oracle 的資料來源在列表中