Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6234697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:32:02+00:00 2026-05-24T10:32:02+00:00

I have created 2 procedure and a java source One procedure is calling java

  • 0

I have created 2 procedure and a java source

One procedure is calling java class TestHostCommand

 PROCEDURE TEST2
  (p_command IN Varchar2)
   AS LANGUAGE JAVA
    NAME 'TestHostCommand.executeCommand(java.lang.String)';

Java Source is:

import java.io.*;

public class TestHostCommand
{

public void executeCommand(String command)
 {
Runtime rt = Runtime.getRuntime();
Process p = null;
try
{
  p = rt.exec("ls > /Orion/list/list.txt");
  return;
} catch ( IOException ioe)
  {
    System.out.println("Error executing file");
  }
}

}

And the other Procedure is to grant permissions but it is generated incorrectly:

     PROCEDURE GRANT_PERMISSION
      (grantee            IN  VARCHAR2,
       permission_type    IN  VARCHAR2,
       permission_name    IN  VARCHAR2,
       permission_action  IN  VARCHAR2)


        IS
        BEGIN
         DBMS_JAVA.grant_permission ('ORION', 'java.io.FilePermission',
                                   '<>', 'read ,write, execute, delete');

         DBMS_JAVA.grant_permission ('ORION', 'SYS:java.lang.RuntimePermission',
                                               'writeFileDescriptor', '');

          DBMS_JAVA.grant_permission ('Orion', 'SYS:java.lang.RuntimePermission',
                                                 'readFileDescriptor', '');

           END; 

Error is invalid object.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T10:32:03+00:00Added an answer on May 24, 2026 at 10:32 am

    The third parameter in the first statement should be a file or directory path, e.g.

         DBMS_JAVA.grant_permission ('ORION', 'java.io.FilePermission',
                                   '/home/orion/*', 'read ,write, execute, delete');
    

    Alternatively you could just grant ORION the JAVASYSPRIV role instead, as it’s pretty much what you’re doing anyway.

    Either way, granting maximal privileges to ORION makes the account very poweful, and one which you will need to control tightly, especially in production environments.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created and launch the SQLJ Java procedure (using SQL Developer). I have some
I have the following Java stored procedure: CREATE OR REPLACE AND RESOLVE JAVA SOURCE
I'm working on a Java project where I have created a class that looks
I have a java program that is calling a MySQL stored procedure that is
I have Created a Procedure for one of our .Net Devs where they can
I have created one stored procedure which runs on 5000 users in tbluser table
I have created a PL/SQL a Java Source, and privileges have been granted. The
I have created the following stored procedure.. CREATE PROCEDURE [dbo].[UDSPRBHPRIMBUSTYPESTARTUP] ( @CODE CHAR(5) ,
I have just created a report in Report Manager using a Stored Procedure which
I have a modal dialog that is created with the following: procedure TFormCompose.createParams(var Params:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.