Skip to Main Content

Database Software

SEPS (wallet) seems ignored in Java stored procedure in OJVM

Ghui-OracleNov 26 2020

We are required to code Java stored procedure in DB (because needs to be called by PL/SQL) and make separate remote DB connection, and using wallet. Tried standalone Java code with using wallet is working properly. When put the same code to DB with "loadjava", publish the function in PL/SQL we tested and found it always responds with ORA-1017:

java.sql.SQLException: ORA-01017: invalid username/password; logon denied 
   at oracle.jdbc.driver.T4CTTIoer.processError( 
   at oracle.jdbc.driver.T4CTTIoer.processError( 
   at oracle.jdbc.driver.T4CTTIoer.processError(
   at oracle.jdbc.driver.T4CTTIfun.processError(
   at oracle.jdbc.driver.T4CTTIoauthenticate.processError(
   at oracle.jdbc.driver.T4CTTIfun.receive(
   at oracle.jdbc.driver.T4CTTIfun.doRPC(
   at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(
   at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(
   at oracle.jdbc.driver.T4CConnection.logon(
   at oracle.jdbc.driver.PhysicalConnection.connect(
   at oracle.jdbc.driver.T4CDriverExtension.getConnection(
   at oracle.jdbc.driver.OracleDriver.connect(
   at java.sql.DriverManager.getConnection(
   at java.sql.DriverManager.getConnection(
   at dbconn.pass_string(dbconn:33)

When modified the code to feed set user and password in connection properties this Java stored procedure works as expected. The same code running "outside" OJVM is okay, the Java code has the required system properties set, and connection is using TNS alias, like:

Connection con=DriverManager.getConnection("jdbc:oracle:thin:/@JUAT")

But it seems it only recognizes the "" property (as it found with the TNS alias) but not the wallet_location property when running in the OJVM.
This issue we tested happens in 19c (19.8) and also 12c (12.1), so would it be OJVM does not work with SPES by design (but I see no doc or info saying so)? Or anything missing in Java code certain properties need to be set to make it work?
I know when using SPES in Java we need to include "oraclepki.jar" in classpath, while in OJVM we do not have this option, would it be related?

Post Details
Added on Nov 26 2020