Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

When using JDBC I like the new DataSource-way to establish the connection. Further I like the isolated set-Methods for the properties like setUser, setPassword, setDriverType, setServerName, setNetworkProtocol, setDatabaseName, setPortNumber and so on.
The question is (esp. for the use with Oracle), if there is a way to set up LoadBalancing with two or more servers without specifying the URL directly with

setURL("jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=ON)(ADDRESS=(PROTOCOL=TCP)(HOST=dbsrv1)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=dbsrv2)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=dbpool)))");

for example.

share|improve this question
    
Maybe someone could add the tags datasource, load-balancing and connection? Thanks. –  Bastian Ebeling Feb 15 '13 at 11:31
1  
It's easier to do it using tnsnames.ora, but that doesn't answer your question ;) –  Phil Feb 15 '13 at 11:47
add comment

1 Answer 1

Thin client can also use alias defined in tnsnames.ora. In java call set -Doracle.net.tns_admin=...
http://docs.oracle.com/cd/B19306_01/java.102/b14355/urls.htm

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.