2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

AWS AthenaにJDBC接続する(JDBC42.jar)

Posted at

概要

athenaにJDBC接続しようとしましたがうまく動作しませんでした。(環境によると思います)
調べてみたらathenaに利用するJDBCドライバーが新しくなった模様、公式のドキュメントがまだ更新されていないようなので記載

環境

Windows7 64bit

既存のドライバで接続

https://s3.amazonaws.com/athena-downloads-archive/drivers/AthenaJDBC41-1.0.1.jar
ぐぐるといっぱい出てくるので割愛しますが、ドライバを落としてURL・ID/PASS・s3_staging_dirを設定

接続には成功しますが、クエリを投げるとエラーに

DEBUG - Using AWS accessId and SecretKey
DEBUG - --------------> Type Info
ERROR - Failed to run query: com.amazonaws.athena.jdbc.shaded.com.amazonaws.services.athena.model.AmazonAthenaException: No Such Method (Service: AmazonAthena; Status Code: 400; Error Code: UnknownOperationException; Request ID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX)

新しいドライバでの接続

https://s3.amazonaws.com/athena-downloads/drivers/JDBC/AthenaJDBC42.jar
基本的に従来の設定と一緒ですが、URLとオプション名称が変わっているので注意

SQL WorkBench/J

  1. Manage Drivers > Create a New entry
    1.PNG
  2. driverに↑で作成したdriverを選択し、usernameにaccess key、passwordにsecret keyを入力
  3. Extended PropertiesをクリックしS3OutputLocationを設定
    2.PNG

DBeaver

  1. Database > Driver Manager > New
    3.PNG
  2. New Connection Wizard > athena JDBC

4.PNG
5.PNG

備考

マニュアル
https://s3.amazonaws.com/athena-downloads/drivers/JDBC/docs/Simba+Athena+JDBC+Driver+Install+and+Configuration+Guide.pdf

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?