Cannot configure Data Source in IntelliJ IDEA using Oracle Wallet

977 views Asked by At

I have a working Oracle Wallet. I'm trying to configure a Data Source in IntelliJ IDEA (and/or DataGrip) that uses a TNS connection type. Under the General tab, I filled up the TNSADMIN field with the location of the Oracle Wallet (that contains only the files: cwallet.sso, ewallet.p12, sqlnet.ora, and tnsnames.ora...nothing else), and TNS name with the actual data source name.

There is an environment variable WALLET_HOME that points to the exact location also.

Additionally I have modified (under the Advanced tab) the keys oracle.net.tns_admin and oracle.net.wallet_location with the values: ${WALLET_HOME} and (SOURCE=(METHOD=FILE)(METHOD_DATA=(DIRECTORY=${WALLET_HOME}))) respectively.

That's pretty much what I have to do to connect to the Oracle database within the application(s).

So it looks that it might work, but I'm getting then this error message: [99999][17167] PKI classes not found. To use 'connect /' functionality, oraclepki.jar must be in the classpath: java.lang.NoClassDefFoundError: oracle/security/pki/OracleWallet.

But I cannot find in this life a place to augment the Java classpath in that screen. I cannot provide a -classpath option as part of the VM options (under Advanced tab) because it will overwrite it.

Can someone using this setup shed some light here?

2

There are 2 answers

0
Yuri Win On BEST ANSWER

To add a file to driver please follow this instruction:

  1. Navigate to File | Data Sources or press Ctrl+Alt+Shift+S.
  2. In the Data Sources and Drivers dialog, click the driver entry to which you want to add a file.
  3. In the Driver files pane, click the (+) icon (Add) and select Custom JARs.
2
Vasilii Chernov On

DataGrip 2021.1 provides Oracle 21.1 JDBC driver with all required jar files.

Also, read DataGrip help article Connect to Oracle Cloud by using wallets