Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Versions available for this page: CUBRID 8.2.1 |  CUBRID 8.3.0 |  CUBRID 8.3.1 |  CUBRID 8.4.0 |  CUBRID 8.4.1 | 

Connection Configuration

The DriverManager is a basic service for JDBC driver management and performs functions such as selecting a database driver and creating a new database connection. If the CUBRID JDBC driver is registered, database connection is made by calling the DriverManager.getConnection (db-url, user-id, password) function. The getConnection function returns the Connection object, which is used for query and command executions and transaction commit or rollback. The parameter db-url, which is for connection configuration, is as follows:

jdbc:cubrid:<host>:<port>:<db-name>:[user-id]:[password]:[?<property> [& <property>]]


<host> ::=

hostname | ip_address


<property> ::=

althosts= <alternative_hosts> | rctime= <second> | charset= <character_set>


<alternative_hosts> :

<standby_broker1_host>:<port> [,<standby_broker2_host>:<port>]

  • <host> : IP address or host name where the CUBRID Broker is running
  • <port> : Broker port number (default : 33000)
  • <db-name> : The name of the database to connect
  • [user-id] : The user that will be connected to the database. There are two users in the database by default: DBA and PUBLIC. If you enter an empty string (" "), you will connect to the database as a PUBLIC user.
  • [password] : If there is no password set for the user, enter an empty string (" ").
  • althosts : One or more host IP of standby broker and connection port to be failed over in HA environment
  • rctime : Interval time (in seconds) to fail over an active server during system failure. For more information, see the example in the HA-Related JDBC Configuration.
  • charset : Character set (charset) of database to be connected
Example 1

--connection URL string when user name and password omitted




--connection URL string when charset property specified




--connection URL string when a property(althosts) specified for HA



--connection URL string when properties(althosts,rctime) specified for HA



--connection URL string when properties(althosts,rctime, charset) specified for HA


Example 2

String url = "jdbc:cubrid:";

String userid = "";

String password = "";


try {

   Connection conn =


   // Do something with the Connection




   } catch (SQLException e) {

       System.out.println("SQLException:" + e.getMessage());

       System.out.println("SQLState: " + e.getSQLState());



Note The rollback function, which requests the transaction rollback, exits when the server completes the work.