CARVIEW |
Select Language
HTTP/2 200
content-type: text/html; charset=UTF-8
last-modified: Tue, 22 Jul 2025 06:44:19 GMT
x-oracle-dms-ecid: 006EfG7nvsCFw0KimTWvkJ000zdw000m7u
custom_cache_rule_location: Default
x-oracle-dms-rid: 0:1
device_type: Any
x-content-type-options: nosniff
host_service: FutureTenseContentServer:12c
custom_akamai_autopurge: NO
content-language: en-US
x-akamai-transformed: 9 34266 0 pmb=mRUM,2
vary: Accept-Encoding
content-encoding: gzip
cache-control: max-age=1800
expires: Thu, 24 Jul 2025 22:36:00 GMT
date: Thu, 24 Jul 2025 22:06:00 GMT
content-length: 14455
set-cookie: JSESSIONID=nfs-eMikCrzu4N4othJGH8n6UAChyL-9Xb8NJxu8-nmsF2UOS_6H!-837857884!1766475224; path=/; HttpOnly
set-cookie: X-Oracle-BMC-LBS-Route=a2485c89482f894457ab47f4a7d56c7f3daeba017a4c84779f031b02f8fc0ba4011c0d5f0618c0a4; path=/; HttpOnly
server-timing: cdn-cache; desc=REVALIDATE
server-timing: edge; dur=443
server-timing: origin; dur=1043
akamai-request-bc: [a=23.11.215.15,b=257804082,c=g,n=IN_KA_BANGALORE,o=20940],[c=c,n=IN_TN_CHENNAI,o=20940],[a=90,c=o]
akamai-grn: 0.0fd70b17.1753394759.f5dc732
set-cookie: akaas_aud-seg-ocom-prod=2147483647~rv=89~id=3d27f6ea31c77fffdb278341b3fe1efb; path=/; Secure; SameSite=None
x-frame-options: sameorigin
content-security-policy: frame-ancestors 'self' https://my.oracle.com https://eeho.fa.us2.oraclecloud.com https://blogs.oracle.com *.khapps.com *.khapps.jp *.lsapps.oracle.com *.lsapps.oracle.jp *.dev-lsapps.oracle.com https://oraclesso.sharepoint.com https://oracle.sharepoint.com https://partners.oracle.com https://partners-stage.oracle.com https://partners-test.oracle.com https://partners-sit.oracle.com https://partners-dev.oracle.com
x-content-type-options: nosniff
x-xss-protection: 1
origin-cache-control: no-store
origin-edge-control: NO_HEADER_PRESENTED
actual-object-ttl: -1
server-timing: ak_p; desc="1753394759065_386651919_257804082_148632_10669_6_6_15";dur=1
JDBC instructions to connect to Oracle Database Cloud Service

Using Java Applications and IDEs with Oracle Database Cloud Service (DBCS)
Access the Oracle Database Cloud Service from Java SE applications, Java Web applications (i.e., Servlets) and Java EE containers using the Oracle JDBC and the Universal Connection Pool (UCP). The following steps will allow a successful connection.
1. Create a Database Instance on Oracle Cloud
- If you already have a database instance created then you can skip this step. Otherwise, create a new database instance by following these steps.
- After you sign up for Oracle Cloud, login to your account (https://cloud.oracle.com). On the Dashboard, you will find Create Instance" button. Click that button and follow the steps to create a database instance.
- Another way to create an instance is to choose Database from the Dashboard and use Open Service Console that lists all the database services. Create a new instance by clicking on "Create Service" button. Check out the Fig.1: Oracle Database Service Console
-
Once the database instance is created, you can click on the new instance created to get the database details. For example., Click on "dev" as shown in Fig.1:Oracle Database Service Console
- The HOST or the IP address can be obtained by viewing detailed information of a database instance.
- The SERVICE_NAME is also present in the detailed information section. The format of the database service name is pdb.identity-domain.oraclecloud.internal
2. Unblock the port 1521
- Oracle Database Cloud Service support access to Oracle Database on the standard Oracle Net Listener port (1521). When a database instance is first created, the Oracle Net Listener port (1521) is blocked to ensure network security. Unblock this port by choosing "Access Rules" as shown in Fig.1:Oracle Database Service Console and choose 1521 the port used by SQL*Net to enable.
Fig.1: Oracle Database Service Console
3. Compile and Run Your Simple Java Application
- Download the 12.2.0.1 JDBC Thin driver (ojdbc8.jar) and 12.2.0.1 UCP (ucp.jar) or 12.1.0.2 JDBC Thin driver (ojdbc7.jar) and 12.1.0.2 UCP (ucp.jar) to a location and add that location to the classpath.
-
Set the connection string according to your environment as illustrated below. For example., you may use the HR schema which is available by default.
Example:
DB_USER = "hr" or <Any user created>
DB_PASSWORD = "hr" or <password chosen while creating a user>
DB_URL = "jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(HOST=<public IP address>)(PORT=1521)(PROTOCOL=tcp))(CONNECT_DATA=(SERVICE_NAME=PDB1.<identity-domain>.oraclecloud.internal)))"; - Compile and Run a Java application:
- [Windows]
java -cp .\lib\ojdbc7.jar;.\lib\ucp.jar UCPSample
-
TroubleShooting Tip: When the database instance is first created, HR user is locked for security reasons. You will receive an error "account locked". So, unlock the HR user using these steps before using it to connect to the database.
- SSH to the compute node of the database
- Login as "oracle" into the compute node.
- Connect to the database as a system user:
sqlplus sys as sysdba
and enter the password chosen while creating the instance. - Alter the session to use PDB:
alter session set container=pdb1;
- Unlock the user "hr":
alter user hr identified by hr account unlock;
4. Connect to Compute Node using SSH tunnel
You can connect to the compute node where the database instance is running through a SSH tunnel. Follow the instructions described in the chapter Creating an SSH Tunnel to a Compute Node Port . After connecting, you can access the database and create new users, change database user password etc.,
Database Cloud Service Resources
Help Center | User Guide | What's New | Troubleshooting Tips - Manuals
Other Developer Resources
JDBC and UCP Landing Page - for Whitepapers, Javadoc, Forum etc.,