About Me

My photo
Rohit is an investor, startup advisor and an Application Modernization Scale Specialist working at Google.

Tuesday, January 23, 2018

Connecting to Oracle Databases from apps in Cloud Foundry

A common use case when replatforming apps is connecting to oracle databases via a user provided service instance. There are three ways these CUPs can defined as specified in the spring cloud connectors #oracle doc. There are some gotchas when defining oracle CUPs. This post provides examples of when and which form of Oracle CUPs to define ...

The connector will check for:
  1. uri using the scheme oracle
  2. jdbcUrl using the subprotocol oracle in the JDBC URL
  3. oracleUri, oracleuri, oracleUrl, or oracleurl fields in credentials
Any of the three approaches will work ...  however;


- If you are using oracle subprotocol , then the CUPs has to be a uri. 

- If your DB url contains the ldap:// prefix before the host name in the URL then use the jdbcUrl credentials property instead of url. 


cf create-user-provided-service catalog-db -p '{"jdbcUrl":"jdbc:oracle:thin:TOMHANKS/<pwd>$2011@(DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=on)(FAILOVER=on)(ADDRESS=(PROTOCOL=TCP)(HOST=espndb.net)(PORT=1555))(ADDRESS=(PROTOCOL=TCP)(HOST=espndb.net)(PORT=1555))(ADDRESS=(PROTOCOL=TCP)(HOST=espndb.net)(PORT=1555)))(CONNECT_DATA=(SERVICE_NAME=cd_app)(FAILOVER_MODE=(TYPE=select)(METHOD=basic)(RETRIES=180)(DELAY=5))))"}'


cf cups ulrDataSource -p “dbURL” oracle://ulr_wsph:facebook123#@rwev10exp.abc.facebook.com:1576/e_facebooklog_rgwd.nbc.us


The Spring cloud connectors library provides ORACLE connectors that automatically wire up your ORCL cups to your Spring datasource bean
http://cloud.spring.io/spring-cloud-connectors/spring-cloud-connectors.html#_extending_spring_cloud_connectors


Significant contributions to this post by Anwar Chirakkattil , Oleg Iavorskyi and Brad Starkenberg

No comments:

Post a Comment