使用 Connector/J 的範例散見於本文件中。本節提供這些範例的摘要和連結。
範例 7.1,「Connector/J:從 DriverManager 取得連線」
DriverManager
範例 7.2,「Connector/J:使用 java.sql.Statement 執行 SELECT 查詢」
SELECT
範例 7.3,「Connector/J:呼叫預存程序」
範例 7.4,「Connector/J:使用 Connection.prepareCall()」
Connection.prepareCall()
範例 7.5,「Connector/J:註冊輸出參數」
範例 7.6,「Connector/J:設定 CallableStatement 輸入參數」
CallableStatement
範例 7.7,「Connector/J:擷取結果和輸出參數值」
範例 7.8,「Connector/J:使用 Statement.getGeneratedKeys() 擷取 AUTO_INCREMENT 資料行值」
Statement.getGeneratedKeys()
AUTO_INCREMENT
範例 7.9,「Connector/J:使用 SELECT LAST_INSERT_ID() 擷取 AUTO_INCREMENT 資料行值」
SELECT LAST_INSERT_ID()
範例 7.10,「Connector/J:在 Updatable ResultSets 中擷取 AUTO_INCREMENT 資料行值」
Updatable ResultSets
範例 8.1,「Connector/J:搭配 J2EE 應用程式伺服器使用連線集區」
範例 16.1,「Connector/J:具有重試邏輯的交易範例」