configure hibernate using oracle rac

The ordinary way to configure hibernate link oracle database is just like this:

<property name=”connection.url”>jdbc:oracle:thin:@192.100.99.103:1521:Orcl</property>
<property name=”connection.username”>ksec</property>
<property name=”connection.password”>ksec</property>

But some times the database server using double network-cards or using rac. Then the configure will be:

<property name=”connection.url”>jdbc:oracle:thin:@
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.100.99.103)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.100.99.104)(PORT = 1521))
(LOAD_BALANCE = yes)
)
(CONNECT_DATA =
(SERVICE_NAME = Orcl)
)
)
</property>
<property name=”connection.username”>ksec</property>
<property name=”connection.password”>ksec</property>

The segment of connection url is copied from oracle configuration file(usually under Oracle_Home\app\product\11.2.0\dbhome_1\NETWORK\ADMIN\tnsnames.ora).

This entry was posted in Computer, Database. Bookmark the permalink.

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