Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2003
    Location
    Torrance Ca 90210
    Posts
    5

    Unhappy Unanswered: Dbms_Java Not Working

    Hi,
    i am trying to write to a file using dbms_java
    i am using the codes in the same order as mentioned below
    i get all success messages on sqlplus but when i chk the required file is
    not created
    -------------------------------------------------------------------------------
    call dbms_java.grant_policy_permission('SDBA', 'SDBA', 'java.io.FilePermission', '*');
    call dbms_java.grant_permission('SDBA','java.io.FilePer mission', '("/home/files/output.txt','write');
    commit;
    -------------------------------------------------------------------------------
    create or replace java source named "WriteFile" AS
    import java.io.*;
    public class WriteFile
    {
    public static void fileWrite()
    {
    try
    {
    File tmpFile = new File("/home/files/output.txt");
    PrintWriter out = new PrintWriter(new FileWriter(tmpFile));
    out.println(new String("Mohan"));
    out.close();
    }
    catch(IOException ioe)
    {
    System.out.println("File IO Error");
    }
    }
    }
    /
    -------------------------------------------------------------------------------
    create or replace procedure WriteFile as
    language java name 'WriteFile.fileWrite()';
    /
    -------------------------------------------------------------------------------
    exec WriteFile;
    -------------------------------------------------------------------------------

    no where i get any error msgs but the file is still not created.
    Last edited by mohank01; 01-06-03 at 03:09.

  2. #2
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    118

    output

    Please try these two:

    SQL> set SERVEROUPUT ON;
    SQL> CALL dbms_java.set_output(1000);

    Good luck

    Remi
    Remi Visser

    Oracle Database Administrator
    (OCP certified 8i)

    Homepage: http://home.remidian.com/

  3. #3
    Join Date
    Jan 2003
    Location
    Torrance Ca 90210
    Posts
    5

    Re: output

    Originally posted by remivisser
    Please try these two:

    SQL> set SERVEROUPUT ON;
    SQL> CALL dbms_java.set_output(1000);

    Good luck

    Remi
    Thanks. The code was coming into exception but the exeception
    msg was not displayed.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •