This topic describes how to use the Java Database Connectivity (JDBC) driver in DBeaver to connect Java applications to PolarDB for PostgreSQL (Compatible with Oracle) databases.
Prerequisites
The DBeaver client is installed.
A database account is created in the PolarDB cluster. For more information, see Create a database account.
The IP address of the host that you use to access the PolarDB cluster is added to an IP address whitelist of the cluster. For information about, see Configure a whitelist for a cluster.
Procedure
In the menu of the DBeaver client, choose . In the Driver Manager dialog box, click New.

In the Create new driver dialog box, configure the driver information.
On the Settings tab, configure basic driver information, including Driver Name, Class Name, URL Template, Default Port, Default Database, and Default User. We recommend that you set Driver Name to PolarDB.
NoteFor Class Name and URL Template, You can use the following values:
Class Name:
com.aliyun.polardb2.DriverURL Template:
jdbc:polardb2://{host}[:{port}]/[{database}]
Default Port, Default Database, and Default User can also be specified when you create a database connection.
On the Libraries tab, click Add File to upload the custom JDBC driver. For more information about how to download the JDBC driver, see JDBC.
Click
to create a connection to the PolarDB database. In the Connect to a database dialog box, select the PolarDB custom JDBC driver that you create and click Next.

Configure the PolarDB database connection information, including Host, Port, Database/Schema, Username and Password, and then click Finish.
