

 Amazon Redshift は、パッチ 198 以降、新しい Python UDF の作成をサポートしなくなります。既存の Python UDF は、2026 年 6 月 30 日まで引き続き機能します。詳細については、[ブログ記事](https://aws.amazon.com/blogs/big-data/amazon-redshift-python-user-defined-functions-will-reach-end-of-support-after-june-30-2026/)を参照してください。

# ドライバークラスの登録
<a name="jdbc20-register-driver-class"></a>

アプリケーションに適したクラスを登録していることを確認してください。Amazon Redshift JDBC ドライバーを Amazon Redshift データストアに接続するには、次のクラスを使用します。
+ `Driver` クラスは を拡張します。`java.sql.Driver`
+ `DataSource` クラスは `javax.sql.DataSource` と `javax.sql.ConnectionPoolDataSource` を拡張します。

ドライバーは、JDBC バージョンに依存しない次の完全修飾クラス名をサポートします。
+ `com.amazon.redshift.jdbc.Driver`
+ `com.amazon.redshift.jdbc.DataSource`

次の例は、DriverManager クラスを使用して JDBC 4.2 用の接続を確立する方法を示しています。

```
            private static Connection connectViaDM() throws Exception
{
Connection connection = null;
connection = DriverManager.getConnection(CONNECTION_URL);
return connection;
}
```

次の例では、`DataSource`クラスを使用して接続を確立する方法を示しています。

```
 private static Connection connectViaDS() throws Exception
{
Connection connection = null;
11
Amazon Redshift JDBC Driver Installation and Configuration Guide
DataSource ds = new com.amazon.redshift.jdbc.DataSource
();
ds.setURL(CONNECTION_URL);
connection = ds.getConnection();
return connection;
}
```