Updated on 2026-06-29 GMT+08:00

Creating a Doris Connection

The following code snippets are in the createConnection method of the JDBCExample class.

USER and PASSWD are the user name and password used for security authentication during connection creation.

Class.forName(JDBC_DRIVER);
String dbUrl = String.format(DB_URL_PATTERN, HOST, PORT);
connection = DriverManager.getConnection(dbUrl, USER, PASSWD);