Creating a JAVA Stored procedure on Oracle

In this blog, we will see how we can create a simple JAVA class on Oracle and calling the class using a simple function.

Without taking more time, let us create one user on the Oracle database and then define a JAVA class and associate it with one Oracle function.

Create one user to test the programme. I have created one user as shown below:

Now let us create a JAVA class, for any program the first thing that comes in mind to start with “Hello World” programme,

Open SQL Developer and connect to the user, once connected then navigate to JAVA :

Now click on connect and then navigate to “JAVA” on the left side and click on “Load JAVA” option.

Now one the give a name and write the JAVA class that you want to use, in my case I am just creating a JAVA class to print “Hello World”.

Once you have written the JAVA class click on apply.

Now as the JAVA class is created let us create one function to call the same JAVA class.

Now let us try to call the function and see if we can get the “Hello World” output.

Now we see the output. So we saw how to create a JAVA store procedure on Oracle and calling it from simple SQL.

Thank you for reading my blog.

Please feel free to leave me some feedback or to suggest any future topics.

Looking forward to hearing from you – Swadhin Ray (Sloba) -( LinkedIn ) ( Twitter )

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.