Skip to Main Content
  • Questions
  • Install a third-party JDBC driver (OsiSoft PI)

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, kjell.

Asked: May 13, 2020 - 10:38 am UTC

Last updated: May 14, 2020 - 5:13 am UTC

Version: Oracle 18.8 on ODA

Viewed 1000+ times

You Asked

Hi,
Want to access an OsiSoft PI database via a JDBC connection in a Java procedure.

Assume the steps are something like this:
- Driver must be installed and loaded
- JDBC connections with use of the JDBC driver to be made.
Would be nice to have these steps in detail of where to install the JDBC driver and then the following commands/script to have the JDBC connection available in Java procedure.

Beforehand thanks
Best regards Kjell



and Connor said...

You would probably need to load the required jars into the database

loadjava -u system/password -resolve -grant PUBLIC -synonym my_jdbc.jar my_jdbc.jar

and then grant permissions to let the java proc talk to the outside world via something like:

dbms_java.grant_permission('uuu', 'SYS:java.net.SocketPermission','ServerName', 'resolve');
dbms_java.grant_permission('uuu', 'SYS:java.net.SocketPermission','x.x.x.x:port', 'connect,resolve');

Also, you might to grant network access via DBMS_NETWORK_ACL_ADMIN. See the docs for examples on this.


Is this answer out of date? If it is, please let us know via a Comment

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library