開發自己的jdbc驅動——可選開發工具
阿新 • • 發佈:2020-10-11
前邊有簡單介紹過關於jdbc驅動開發的說明,以下是一些簡單的整理,提供關於快速開發jdbc的一些參考資料
驅動開發的一些說明
- 需要實現的介面
以下的介面是需要實現的,除過Driver 介面一般都會建立一個抽象類進行擴充套件
Statement
ResultSetMetaData
ResultSet
PreparedStatement
DatabaseMetaData
Connection
Driver
- sql 支援
這個是一個比較複雜的,也是最有意思的,比如我們希望基於sql 語言的模式操作rest api 或者操作檔案內容,操作mongo
我們就需要包含一個sql 解析器,可選的軟體包有
一些參考
drill 就是基於calcite進行的jdbc擴充套件開發,presto 因為自身就支援sql 操作,基於okhttp進行了包裝,apache Pinot 因為也支援
類sql,基於自己的java sdk 進行的包裝
參考資料
https://github.com/javacc/javacc
https://github.com/JSQLParser/JSqlParser
https://calcite.apache.org/
https://github.com/prestosql/presto/tree/master/presto-jdbc
https://github.com/apache/incubator-pinot/tree/master/pinot-clients/pinot-jdbc-client
https://github.com/apache/drill/tree/master/exec/jdbc
https://github.com/apache/calcite