Is it possible to use iFS API within java stored procedure?

question:
is it possible to use the iFS API for file handling
within a java stored procedure (which is invoced by a trigger)?
is there an "elegant" workaround if it is not possible?
problem:
my java code using the iFS API works fine outside
the java stored procedure
but invoked via trigger as java stored procedure
it throws following exception:
IFS-20102: Unable to start service (IfsDefault)
i am using:
oracle 9.0.1
oracle internet file system 9.0.1.1.0
windows 2000
thanks

thanks for your help
i looked through the applications developers guide
the basics behind advanced queueing (as far as i understand) is:
program A inserts a message into the queue - and program B gets message from the queue and processes it
question 1:
but what is the difference between advanced queuing and a queue i create by myself
(simply with a database table) and let application B (which runs in a loop)
check if the queue is filled
or am i missing something important which makes advanced queuing more practicable for my problem?
question 2:
you wrote about advanced queuing support in iFS 9.0.3, but the newest version i found was iFS 9.0.2
did you reffer to the advanced queuing mechanism in general or to a spezial queuing feature in iFS 9.0.3?
thanks

Similar Messages

  • Java Print Service API in Java Stored Procedure (Linux)

    Hi
    We are running an Oracle 10g database on Linux and I am in the proces of developing a java stored procedure which should utilize the Java Print Service API.
    I have made a simple stored procedure to list all available printers and the DocFlavors they support (se the code below).
    My problem is that no printers are listed. I have made a standalone java app. with the same code and executed it directly on the OS level of the Linux box through the Sun JDK 1.4.2 and here I get two printers.
    Is there any specific configuration I need to do to make it work?
    I am wondering if I need to grant specific authorisations through dbms_java for it to work...?
    Any help is greatlyh appreciated.
    ************************************** CODE BEGIN *************************************
    import javax.print.DocFlavor;
    import javax.print.PrintService;
    import javax.print.PrintServiceLookup;
    import javax.print.attribute.HashPrintRequestAttributeSet;
    import javax.print.attribute.PrintRequestAttributeSet;
    public class TestPrintService {
    public TestPrintService() {
    public static void listPrinters() {
    // Get all available printers and their supported DocFlavors
    PrintService[] pservices =
    PrintServiceLookup.lookupPrintServices(null, null);
    System.out.println("Printer services: " + pservices.length);
    for (int i = 0; i < pservices.length; i++) {
    PrintService pservice = pservices;
    System.err.println("Printer: " + pservice);
    DocFlavor[] docFlavors = pservice.getSupportedDocFlavors();
    for (int j = 0; j < docFlavors.length; j++) {
    DocFlavor docFlavor = docFlavors[j];
    System.err.println("DocFlavor " + docFlavor.toString());
    System.err.println();
    ************************************** CODE END *************************************
    Cheers,
    Jacob Vennervald

    Found this on Oracle support:
    Cannot List Available Printers From The Database Using A Java Stored Procedure [ID 372694.1]
    Applies to:
    Oracle Server - Enterprise Edition - Version: 10.1.0.4.0
    This problem can occur on any platform.
    Symptoms
    Able to list available printers on a machine when running Java code outside the Database.
    When running the same Java code inside the Database as a Java Stored Procedure, no printers are found.
    Cause
    Due to security restrictions, this is expected results.
    The Java Docs state:
    "Services which are registered by registerService(PrintService) will not be included in lookup
    results if a security manager is installed and its CheckPrintJobAccess() method denies access."
    Also from the documentation it states:
    "A PrintServiceLookup implementor is recommended to check for the SecurityManager.checkPrintJobAccess() to deny access to untrusted code. Following this recommended policy means that untrusted code may not be able to locate any print services. Downloaded applets are the most common example of untrusted code."
    Using the checkPrintJobAccess(); call, it does produce a Security Exception when run inside the Database but not when run outside. The exception can be viewed within the log file found in the UDUMP directory.
    Solution
    Run the following code to confirm obtaining available __printers can not be done...__
    This is the code to create the Java Stored Procedure
    CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED "ListPrinters" AS
    import javax.print.*;
    public class ListPrinters {
    public static String AvailablePrinters(){
    String strList;
    PrintService[] pservices =PrintServiceLookup.lookupPrintServices(null,null);
    if (pservices.length > 0 )
    strList = pservices[0].getName();
    else
    strList = "No printers found";
    return strList;
    public static String listprinters() throws Exception {
    String listofprinters;
    try {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) sm.checkPrintJobAccess();
    catch (SecurityException ex) {
    System.err.println("Sorry. Printing is not allowed.");
    listofprinters = AvailablePrinters();
    return listofprinters;
    This is the PL/SQL Wrapper
    CREATE OR REPLACE FUNCTION Get_Printer_Test RETURN VARCHAR2 IS
    LANGUAGE JAVA
    NAME 'ListPrinters.listprinters() return String';
    This executes the code
    SQL> SELECT Get_Printer_Test FROM DUAL;
    GET_PRINTER_TEST
    No printers found
    This is the output found in the trace file in the UDUMP directory
    *** SESSION ID:(144.28) 2006-07-08 09:02:25.518
    Sorry. Printing is not allowed.

  • Using Directory alias in Java stored procedure

    hi !!
    I want use Directory alias in Java strored procedure
    I 'hv created dir alias as
    Create Directory BFILE_DIR AS 'C:\MyImages'
    my java statements -
    myfile="C:\MyImages\myPH01.jpg"
    File binaryFile = new File(myFile);
    instead of giving absolute path I want give directory alias BFILE_DIR
    myfile= BFILE_DIR + "myPH01.jpg"
    can anyone pl suugest how should I write this in Java procedure
    thanks
    SPD

    Hi there i am currently trying to develope a java
    stored procedure and place it in oracle and will try
    to use that procedure to send a message to a server
    but then it doesnt seems to work. is it possible?And what do you do with exceptions in your java proc?
    I haven't ever done it myself, but I would be very surprised if it wasn't possible. I also wouldn't be surprised to find out that you have to configure various things to allow it in Oracle itself.

  • Using socket programming in java stored procedure

    Hi there i am currently trying to develope a java stored procedure and place it in oracle and will try to use that procedure to send a message to a server but then it doesnt seems to work. is it possible?
    The server and the database is in the same pc and the server is just a small program listening to a port. Hope someone can help me thanks

    Hi there i am currently trying to develope a java
    stored procedure and place it in oracle and will try
    to use that procedure to send a message to a server
    but then it doesnt seems to work. is it possible?And what do you do with exceptions in your java proc?
    I haven't ever done it myself, but I would be very surprised if it wasn't possible. I also wouldn't be surprised to find out that you have to configure various things to allow it in Oracle itself.

  • Using XMLType in a Java Stored Procedure

    I have the following piece of java test code that attempts to read an XMLType object from the database. When I run this client side, using either the oci or thin driver it works fine. When I run the same code as a java stored procedure I get the exception shown below.
    (The problem was first seen on 9.2.0.3/Win2K. Ive patched to 9.2.0.4 and am still getting the same error)
    Can anybody please help?
    Thanks
    Java Test Code:
    ===============
    import java.sql.*;
    import oracle.sql.*;
    import oracle.jdbc.*;
    import oracle.xdb.*;
    public class Test {
    public static void main(String[] args) throws Exception {
    System.out.println(run());
    public static String run() throws Exception {
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    // client side THICK
    //Connection conn = DriverManager.getConnection("jdbc:oracle:oci8:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SID=ORACLE)))", "scott", "tiger");
    // client side THIN
    //Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:ORACLE", "scott", "tiger");
    // server side
    Connection conn = DriverManager.getConnection("jdbc:default:connection");
    OracleCallableStatement stmt = (OracleCallableStatement)conn.prepareCall("{? = call XDBUriType('/test.xml').getXML()}");
    stmt.registerOutParameter (1, OracleTypes.OPAQUE,"SYS.XMLTYPE");
    stmt.execute();
    XMLType xml = XMLType.createXML(stmt.getOPAQUE(1));
    return xml.getStringVal();
    SQLPLUS TRACE:
    ==============
    SQL> VARIABLE res VARCHAR2(4000);
    SQL> call run() into :res;
    call run() into :res
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.lang.Exception: Unimplemented Feature
    Dump File:
    ==========
    Dump file c:\oracle9i\admin\oracle\udump\oracle_ora_4964.trc
    Fri Oct 24 12:04:30 2003
    ORACLE V9.2.0.3.0 - Production vsnsta=0
    vsnsql=12 vsnxtr=3
    Windows 2000 Version 5.0 Service Pack 4, CPU type 586
    Personal Oracle9i Release 9.2.0.3.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.3.0 - Production
    Windows 2000 Version 5.0 Service Pack 4, CPU type 586
    Instance name: oracle
    Redo thread mounted by this instance: 1
    Oracle process number: 12
    Windows thread id: 4964, image: ORACLE.EXE
    *** 2003-10-24 12:04:30.000
    *** SESSION ID:(10.121) 2003-10-24 12:04:30.000
    java.lang.Exception: Unimplemented Feature
    at oracle.xdb.spi.XDBContext.getServerEnv(XDBContext.java)
    at oracle.xdb.XMLType.initConn(XMLType.java:1874)
    at oracle.xdb.XMLType.<init>(XMLType.java:846)
    at oracle.xdb.XMLType.createXML(XMLType.java:469)
    at cms.Test.run(Test.java:27)

    I have the very same problem. Somebody from Oracle Corp please reply. If this is a bug, please do not let us waste time to research a solution. Otherwise, point a way out!
    Thanks,

  • How to use directory alias in Java stored procedure ?

    hi everyone !
    I want use Directory alias in Java strored procedure
    I 'hv created dir alias as
    Create Directory BFILE_DIR AS 'C:\MyImages'
    my java statements -
    myfile="C:\MyImages\myPH01.jpg"
    File binaryFile = new File(myFile);
    instead of giving absolute path I want give directory alias BFILE_DIR
    myfile= BFILE_DIR + "myPH01.jpg"
    File binaryFile = new File(myFile);
    can anyone pl suugest how should I write this in Java procedure
    thanks
    SPD

    hi everyone !
    I want use Directory alias in Java strored procedure
    I 'hv created dir alias as
    Create Directory BFILE_DIR AS 'C:\MyImages'
    my java statements -
    myfile="C:\MyImages\myPH01.jpg"
    File binaryFile = new File(myFile);
    instead of giving absolute path I want give directory alias BFILE_DIR
    myfile= BFILE_DIR + "myPH01.jpg"
    File binaryFile = new File(myFile);
    can anyone pl suugest how should I write this in Java procedure
    thanks
    SPD

  • Can I use log4j with a java stored procedure

    I have code that resides on the middle tier and on the database. Our company is using log4j for debugging purposes. In order to get my code to work on the database, I have had to remove all the log4j stuff. Has anyone tried to get code that has log4j messages to run on the database? I am not concerned with actual debugging, I just don't want to have to strip this code out if I can avoid it.

    Hi Laura,
    As far as I know, you have two choices:
    1. Load the log4j classes into the database (using the "loadjava" tool).
    2. Enable remote invocation of log4j classes via RMI (or similar).
    Hope this helps.
    Good Luck,
    Avi.

  • Sending email from within a stored procedure

    Is it possible to send and email within a stored procedure written in PL/SQL. I have searched this site and the web for an Oracle package which simulates a mail agent written in PL/SQL, but I have not had any success.
    null

    Well, on NT one way we did it was to link to kernel32.dll so we could execute OS commands (WinExec), and did the email that way.
    Here's a bit of script to try:
    connect sys/@db;
    drop library kernellib;
    CREATE LIBRARY kernellib as 'c:\winnt\system32\kernel32.dll';
    show errors
    CREATE OR REPLACE PACKAGE UTIL IS
    function run(lpCmdLine IN varchar2, nCmdShow IN binary_integer) return binary_integer;
    end;
    show errors
    CREATE OR REPLACE PACKAGE BODY UTIL IS
    function run(lpCmdLine IN varchar2, nCmdShow IN binary_integer) return binary_integer
    AS EXTERNAL
    NAME "WinExec"
    LIBRARY kernellib
    parameters (lpCmdLine STRING, nCmdShow long);
    end;
    show errors
    Then you just call util.run() with an appropriate command line to send email. Bit of a hack, but it depends on what you want to do with it. Another hack would be to use the UTL_HTTP package to submit a form to your web server and use a CGI program to send the email.

  • How to call java stored procedure using RMI?

    Is it possible to make a call to java stored procedure using RMI. ?
    How can I run the RMI registry on the Oracle Server ?

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Thomas Grounds ([email protected]):
    Is it possible to make a call to java stored procedure using RMI. ?
    In principle it is possible. See the Java-Doc.s of Oracle 8.1.6.
    I have successful granted the java.net.SocketPermissions in my USER_JAVA_POLICY view (see Doc.) Now I was able to use the RMI-Sockets, but following
    failure try to connect to RMI-Object via RMIregistry an Oracle Error occurs
    ORA-03113: end-of-file on communication channel
    and after that my Oracle Connection is closed.
    How can I run the RMI registry on the Oracle Server ?<HR></BLOCKQUOTE>
    I think you do not need the RMI registry on Oracle Server. It should be possible to start the RMI registry wherever you want in your network and access it via the right registry string.
    Ciao
    Margit
    null

  • How to use a Java Thread in a Java Stored Procedure?

    I am working with java stored Procedures but i have a problem when i use threads.While the thread is running all the processes are blocked because the thread is not detatched.I don't know if it is impossible to use Thread in a java stored procedure.i made many researches but didn't find information about this case of Thread.If someone knows what to do in this case it will be helpfull for me.Thanks

    The JAR is already load by using CREATE JAVA RESOURCE ... or "loadjava -resolve –force -user p/p@SID –genmissing -jarasresource MyJar.jar"
    If we can create a resource by SQL or loadjava, how can I use it in my java code?
    Edited by: 847873 on 28 mars 2011 06:05
    Edited by: 847873 on 28 mars 2011 06:07

  • Is it possible to use a Script within an action? - it doesn't seem to work...

    Is it possible to use a Script within an action? - it doesn't seem to work...
    I'm using the 'round any corner' script from SATO Hiroyuki..., and  I'd like to apply it to only one anchor point (on multiple boxes)

    An Action can call a script from the File>Scripts menu by means of the Add Menu Item Action step. But it will only work for the duration of your Illustrator work session. If you quit AI and then restart it, the Add Menu Item step will be blank. This bug has been reported for FOUR FULL VERSIONS of this sloppy program.
    However, if I am correctly understanding your description of what you are trying to automate, an Action will not be able to automate the selection of a particular anchorpoint in multiple paths. You'd have to make the selections all at first. Whether the script would then apply as desired to each path depends on how the script is written.
    JET

  • Help with use of Java Stored Procedures to invoke Java Code within Applicat

    Good afternoon everyone
    Our development team is looking for some assistance/validation of a design strategy we are deploying for a client. Let me first layout the environment and then the design issue at hand:
    Business User Workstation component: Oracle SQL*Developer 1.5.x
    Reporting Tool: Actuate e.Spreadsheet A10
    Application Web UI: J2EE application developed with Eclipse
    Application Scripting: Application has a scripting component whereby business users can write Oracle PL/SQL to perform many of the functions that are available in the Web UI, but can be batched up or repeated several times.
    Application Server WebLogic 9.2.3 (client constraint)
    Database Serve: Oracle 11g, Release 11.1.0.7
    Lots of other stuff included but irrelevant for this conversation.
    Here's the scenario in question:
    1.     Through the scripting solution, the application user must use PL/SQL to invoke functionality within the Web UI. All PL/SQL that the application user creates does not contain any SQL. Instead our security model mandates that “pre-defined” routines will perform all of the SQL operations against the database; the application user simply invokes the stored procedures of functions to perform activities in the database.
    2.     There is a component of the scripting application that facilitates the creation of reports. In our application, we are using Actuate’s e.Spreadsheet Engine to create the report and format the report based on a template. The template is provided as input, as well as other data items, into Actuate for processing. The net result is the report is created by the Actuate e.Spreadsheet engine in pdf format and then sent back to the user for distribution to other users in the company.
    3.     The Actuate e.Spreadsheet engine consists of one or more JAR files within the Application Server framework. The Web UI utilizes these JAR files as well to perform report generation and data manipulation activities. In the case of the reporting functionality, the pdf report that is generated by Actuate is returned into either the Web UI or into the scripting component for persistence in the database. The mechanism exists to create multi-step jobs that can create multiple reports in one run.
    4.     So to facilitate the above, we are creating one or more Java Stored Procedures that will mediate the communication between the PL/SQL the user’s create and the Java components that are required for business processing. PL/SQL will invoke one or more Java Stored Procedures. Then the Java Stored Procedures invoke Actuate e.Spreadsheet, generate the report, saves the report in the database and returns control back to the invoking procedure.
    So the question is: Is this a viable and correct use of Oracle Java Stored Procedures. What are the advantages/disadvantages of doing so? Any security issues or potholes that you can think of? Tuning issues for the JVMs? Any white papers that you can think of?
    For any Oracle employees that respond, material such as Oracle Whitepapers, etc. would be great.
    I can be contacted at (313) 227-4350 or at [email protected]
    Thanks in advance.

    So are you planning on loading the entire e.Spreadsheet engine into the database server's JVM?
    If so, I would expect that to work, but I expect that you'd have some performance issues. I'd expect that the process of building these PDFs is going to be relatively expensive. Tuning the database server's JVM tends to be rather more challenging than tuning JVM's in an app server.
    If not, I'm not sure how the Java stored procedure would invoke the e.Spreadsheet engine on the application server. It is possible to use Oracle AQ to send a JMS message, but I don't think you can use the standard J2EE JMS APIs-- I think you'd have to use Oracle's AQ interface.
    Justin

  • How to use excel api in java?

    I need to use excel api in Java to generate data in excel format. Can any one tell any of the use ful Excel api that we can down load from net? i have read about Apache's POi-hssf-Java api. But the jar i downloaaded from Apache site is not working ? Can anybody please send me the jar for taht Api ?

    Hi,
    In fact i was not clear about whcih jar file to download from the apache site. i found one folder structure like this
    -parent
    -bin
    -src
    All these folders contained some zip files. i took the zip files and extracted them. And i set teh class path also . But when i tried to import in java programs ,these jar files are giving compilation errors

  • Using 2 refcursors within the same procedure

    Hi,
    Can we use 2 refcursors within the same procedure. This might sound strange. But I have a scenario of doing so- one for dynamically checking for some validations and another for returning a result set.

    Yes, go thru the below example.
    CREATE OR REPLACE PACKAGE CURSPKG AS
    TYPE T_CURSOR IS REF CURSOR;
    PROCEDURE OPEN_TWO_CURSORS (EMPCURSOR OUT T_CURSOR,
    DEPTCURSOR OUT T_CURSOR);
    END CURSPKG;
    CREATE OR REPLACE PACKAGE BODY CURSPKG AS
    PROCEDURE OPEN_TWO_CURSORS (EMPCURSOR OUT T_CURSOR,
    DEPTCURSOR OUT T_CURSOR)
    IS
    V_CURSOR1 T_CURSOR;
    V_CURSOR2 T_CURSOR;
    BEGIN
    OPEN V_CURSOR1 FOR SELECT * FROM EMP;
    OPEN V_CURSOR2 FOR SELECT * FROM DEPT;
    EMPCURSOR := V_CURSOR1;
    DEPTCURSOR := V_CURSOR2;
    END OPEN_TWO_CURSORS;
    END CURSPKG;
    I hope it would be helpful.

  • Using Windows API in Java

    hi,
    How can i use windows api in java.
    regards
    Malik Faisal

    By writing a wrapper in JNI.
    JNI Tutorial.

Maybe you are looking for

  • Error in the Work item

    Dear All,              I am getting the manager is trying to see the work item. he is getting this error. "Message number cannot be read from workflow container". What may be the problem for this. how to resolve this issue. Message number cannot be r

  • Zcm11 remote control crashes?

    We started a ZCM rollout. Currently doing live testing in 1 building. The clients are XP SP3 and server is ZCM11 on OES Linux. I have noticed a problem with remote control after remoting into a workstation and logging on to the workstation i loose co

  • AVG/Yahoo Search has taken over my new tab, how can I reset it?

    I opened Firefox today and my "new tab" is suddenly AVG/Yahoo Search. I'm the only person who uses this computer and I never OK'd it. I normally have it either at a blank tab or the website thumbnails. There is a button ON the search page that says y

  • Edit pdf on desktop

    Ive uploaded files to acrobat.com from my mobile device. Im able to highlight and and text on mobile device but dont have those options on my desktop. Please help. Thanks

  • IMAP & GSSAPI & Kerberos

    i am developing a simple mail client. I want that when client computer joined in a Domain like ActiveDirectory, he can be able to connect his IMAP account without using his password. I think it can be done by using Kerberos tickets (?is it true?) and