2

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.

  • 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
2

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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