{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/ja/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Trino 用 JDBC ドライバ","description":"Treasure Data Product Documentation · Collect and Unify · Segment and Activate · Experiment and Analyze · Decisioning Automate with AI Scale and Trust.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"trino-用-jdbc-ドライバ","__idx":0},"children":["Trino 用 JDBC ドライバ"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["JDBC ドライバを使用して Treasure Data の Trino (別名 PrestoSQL) に接続します。"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/tools/cli-and-sdks/jdbc-driver-for-presto#limitations"},"children":["制限事項"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/tools/cli-and-sdks/jdbc-driver-for-presto#setup"},"children":["セットアップ"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/tools/cli-and-sdks/jdbc-driver-for-presto#connection-url-examples"},"children":["接続 URL の例"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/tools/cli-and-sdks/jdbc-driver-for-presto#example-code"},"children":["サンプルコード"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"制限事項","__idx":1},"children":["制限事項"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Trino JDBC 接続にはいくつかの制限があります:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["setAutoCommit(false) はトランザクションがサポートされていないため例外をスローします。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["trino-jdbc クエリは、Treasure コンソール または REST API から送信する他のアドホックまたはスケジュールされたクエリに利用可能な同じ Trino リソースを共有します。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Trino-jdbc クエリは、以下の標準エントリを除いて、アカウントのジョブログに表示されます:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["クエリ結果テーブル"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["クエリプラン"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["進行状況ログ"]}]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["クエリ結果は、別々のツールで表示するために送り返される前に JSON に変換されます。そのため、非常に大きな結果テーブルは表示されるまでに時間がかかる場合があります。レイテンシの問題がある場合は、サポートにお問い合わせください。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["特定の BI ツールは、システムで失敗したクエリを引き起こす「information_schema」リクエストを発行します。これは、最初の使用時にツールで問題になる可能性があります。"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ベータ使用中に発生した予期しないエラー/バグ/ログが表示された場合は、サポートにお問い合わせください。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["この API を可能な限り稼働し続けることを目指しています。具体的には、月に合計1時間未満のダウンタイムを達成することを期待しています。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"セットアップ","__idx":2},"children":["セットアップ"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["ダウンロード"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://repo1.maven.org/maven2/io/trino/trino-jdbc/423/trino-jdbc-423.jar"},"children":["Trino 用 JDBC ドライバ"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["セキュアな HTTPS (ポート 443) 接続を使用するには、presto 0.148 以降を使用する必要があります。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["開発サーバーで prestobase に接続するには、以下のパラメータを使用します:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ドライバ名: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["io.trino.jdbc.TrinoDriver (PrestoSQL Driver を使用する場合は、io.prestosql.jdbc.PrestoDriver を使用できます)"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["user: (Treasure API キー)"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["password: (ダミー文字列。この値は無視されます)"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["presto-jdbc 0.180 以降、",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/prestodb/presto/issues/8566"},"children":["バグ"]},"のため、パスワードにダミー文字列を設定する必要があります。"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"接続-url-の例","__idx":3},"children":["接続 URL の例"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["接続 URL は以下の形式である必要があります:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["jdbc:trino://api-presto.treasuredata.com:443/td-presto/(database name)?SSL=true"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["または"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["jdbc:presto://api-presto.treasuredata.com:443/td-presto/(database name)?SSL=true"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["例:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["jdbc:trino://api-presto.treasuredata.com:443/td-presto/sample_datasets?SSL=true"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["または"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["jdbc:presto://api-presto.treasuredata.com:443/td-presto/sample_datasets?SSL=true"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"サンプルコード","__idx":4},"children":["サンプルコード"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"$ javac Sample.java\n$ java -cp .:trino-jdbc-0.359.jar Sample (your TD API key)\ntime=1412351990, method=GET, path=/category/office\ntime=1412351976, method=GET, path=/item/software/2265\ntime=1412351961, method=GET, path=/category/toys\ntime=1412351947, method=GET, path=/item/electronics/3305\ntime=1412351932, method=GET, path=/category/software\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"samplejava","__idx":5},"children":["Sample.java"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"java","header":{"controls":{"copy":{}}},"source":"import java.sql.*;\n\nclass Sample {\n    public static void main(String[] args) {\n        if (args.length != 1) {\n            System.err.println(\"Provide your TD API key as an argument\");\n            return;\n        }\n\n        String apikey = args[0];\n        try {\n            Connection conn = DriverManager.getConnection(\"jdbc:trino://api-presto.treasuredata.com:443/td-presto/sample_datasets?SSL=true\", apikey, \"dummy_password\");\n            Statement stmt = conn.createStatement();\n            try {\n                ResultSet rs = stmt.executeQuery(\"SELECT time, method, path from www_access limit 5\");\n                while (rs.next()) {\n                    long time = rs.getLong(1);\n                    String method = rs.getString(2);\n                    String path = rs.getString(3);\n                    System.out.println(String.format(\"time=%s, method=%s, path=%s\", time, method, path));\n                }\n            } finally {\n                stmt.close();\n                conn.close();\n            }\n        } catch (Exception e) {\n            e.printStackTrace();\n        }\n    }\n}\n","lang":"java"},"children":[]}]},"headings":[{"value":"Trino 用 JDBC ドライバ","id":"trino-用-jdbc-ドライバ","depth":1},{"value":"制限事項","id":"制限事項","depth":1},{"value":"セットアップ","id":"セットアップ","depth":1},{"value":"接続 URL の例","id":"接続-url-の例","depth":1},{"value":"サンプルコード","id":"サンプルコード","depth":1},{"value":"Sample.java","id":"samplejava","depth":2}],"frontmatter":{"seo":{"title":"Trino 用 JDBC ドライバ"}},"lastModified":"2026-06-01T09:34:27.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/ja/tools/cli-and-sdks/jdbc-driver-for-presto","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}