This is how to connect Treasure Data's Presto using Presto JDBC Driver:
- Download presto-jdbc driver https://prestodb.io/docs/current/installation/jdbc.html
- For using secure HTTPS (port 443) connection you need to use presto 0.148 or later.
- Use the following parameters to connect prestobase on development server:
- Driver name:
com.facebook.presto.jdbc.PrestoDriver
- user: (Your TD API key)
- password: (can be empty or any string)
- Driver name:
- Connection URL examples:
jdbc:presto://api-presto.treasuredata.com:443
jdbc:presto://api-presto.treasuredata.com:443/td-presto
jdbc:presto://api-presto.treasuredata.com:443/td-presto/sample_datasets
- Limitations
- PreparedStatements is not yet supported
- setAutoCommit(false) will throw an exception since we do not support transactions.
Download presto-jdbc driver from https://prestodb.io/docs/current/installation/jdbc.html
$ javac Sample.java
$ java -cp .:presto-jdbc-0.152.jar Sample (your TD API key)
time=1412351990, method=GET, path=/category/office
time=1412351976, method=GET, path=/item/software/2265
time=1412351961, method=GET, path=/category/toys
time=1412351947, method=GET, path=/item/electronics/3305
time=1412351932, method=GET, path=/category/software