Oracle JDBC URL types

In Oracle Weblogic we define an url for every datasource. Hereby an overview of the different types URL’s. Note the database service name which points to the RAC listeners.

Simple JDBC Connection String

jdbc:oracle:thin:@localhost:1521:xe

Load-Balanced JDBC Connection String

jdbc:oracle:thin:@(description=(address_list=
(load_balance=on)
(failover=on)
(address=(protocol=tcp)(host=dev-database-2.org.com)(port=1521))
(address=(protocol=tcp)(host=dev-database-2.org.com)(port=1521)))
(connect_data=(service_name=rac1)))

Failover JDBC Connection String

jdbc:oracle:thin:@(description=(address_list=
(load_balance=off)
(failover=on)
(address=(protocol=tcp)(host=dev-database-2.org.com)(port=1521))
(address=(protocol=tcp)(host=dev-database-2.org.com)(port=1521)))
(connect_data=(service_name=rac1)))

Advertisements
Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: