Skip to Main Content

Java and JavaScript in the Database

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Editing Java Source Objects

Matthew MorrisFeb 21 2018 — edited May 8 2018

I have been an Oracle PL/SQL developer for a couple of decades, but never done much at all with Java. Recently I needed to give one of my applications the ability to update an Excel spreadsheet from within the database. I downloaded the Apache POI libraries, loaded the classes into Oracle, created a Java Source object that performed the Excel operations I needed, and then call that from PL/SQL when required.  Simple.

The problem is that all of the Java Source development I performed was in Notepad. I wrote the SQL statement, then copied and pasted the 'CREATE OR REPLACE JAVA SOURCE' text into SQL*Developer, then manually checked for errors, then updated the SQL in Notepad for the next go round. SQL*Developer doesn't even show JAVA SOURCE objects in its listing of database objects.  If there's a way to edit Java source objects from SQL*Dev, I can't find it.

My first foray into using the Apache POI tools to update Excel was for a very specific need (one spreadsheet template). The code I wrote works great, but is useless outside that one spreadsheet.  I want to develop a 'next generation' of the code which will allow me more flexibility in updating Excel spreadsheets.  However, I need a better development environment than Notepad for doing this.

I downloaded and installed JDeveloper on the theory that it would allow me to edit/recompile/debug Java Source objects.  It probably can -- but I can't figure out how to do it.  It seems to be more geared towards creating Java applications outside the database. None of the tutorials I located for JDeveloper deal with Java Source objects in the database. Ultimately then my question is what is a good IDE for editing Java Source objects?  If it's possible to do from JDeveloper (or preferably SQL*Developer, I would love to know how you go about doing so.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 5 2018
Added on Feb 21 2018
2 comments
2,263 views