Home > OS >  Direct database connection on Oracle Cloud Infrastructure (OCI)
Direct database connection on Oracle Cloud Infrastructure (OCI)

Time:12-23

I got a free Oracle Cloud Infrastructure (OCI) service from Oracle for two months. I would like to create an Oracle database and connect to it directly over the internet (I don't want to create a VPN tunnel).

Do you know how I should do it?

CodePudding user response:

One way to do it, use this URL pattern:

jdbc:oracle:thin:/@OCI_DB_NAME_high?TNS_ADMIN=PATH_TO_THE_WALLET_FOLDER

user name and password as usual, the Wallet should be unzipped.

Properties info = new Properties();     
info.put(OracleConnection.CONNECTION_PROPERTY_USER_NAME, DB_USER);
info.put(OracleConnection.CONNECTION_PROPERTY_PASSWORD, DB_PASSWORD);          
... 

OracleDataSource ods = new OracleDataSource();
ods.setURL(DB_URL);    
ods.setConnectionProperties(info);

OracleConnection connection = (OracleConnection) ods.getConnection();

CodePudding user response:

I solved the problem myself.

To get to the database server without configuring a VPN link, you can create a virtual machine accessible via an external IP address and ssh from it to a local address from the 10.0.0.0 network

  • Related