Utilizing a java stored procedure for web services

Hello,
I am a newbie in web services and I want to learn web services by utilizing a simple procedure and making use as a web service.
I have a java stored procedure deployed in Oracle 8i database, which I am using for sending emails. I am invoking the java stored procedure in my JSP and Java classes by making a database connection and calling the procedure.
I am planning to make this a web service so that I could call this from any of my application.
Could someone give an insight how to make this a web service, albeit the utility is not very complex and my knowledge about web services is limited, I thought I could start by doing a simple program.
Any help is highly appreciated.
Thanks
Ponic

Hi Tanna.
Thanks for your reply^^
I create webservice that access my stored procedure.
But not supported.
http://dmp.humaxdigital.com/HumaxCmdwService/Service1.asmx?wsdl
There are two service. (Hello World - Test, prcrelease_test - Stored Procedure )
'Hello World' is supported but prcrelease_test is not supported. I can't drag to storyboard.
Our company's DB is MSSQL2005.
please help me^^

Similar Messages

  • Stored Procedure For Web Service in Visual Composer 7.1

    Hello,
    I want to use stored procedure for Webservice in Visual Composer 7.1
    I can find this Web service but not supported. ( ex) prcreleased_test - Not supported )
    Log.
    Message: Error in connection - Can' t execute Web service.
    Date: 2008-07-01
    Time: 16:41:43:906
    Category: com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent
    Location: com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent.processExecution: 
    Application: sap.com/test~kmshim_wf_impl
    Thread: HTTP Worker [1]
    Data Source: j2ee\cluster\server0\log\defaultTrace_00.trc
    Correlator ID: 240496500000034715
    Argument Objects: 
    Arguments: 
    DSR Component: n.a.
    DSR Transaction: cb4b3560473711dd9fb4001e4f3b8fcb
    Log2
    Message: Stopped further execution since the interpreter is unusable
    Date: 2008-07-01
    Time: 16:41:43:906
    Category: com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent
    Location: com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent.XGLInterpreter
    Application: sap.com/test~kmshim_wf_impl
    Thread: HTTP Worker [1]
    Data Source: j2ee\cluster\server0\log\defaultTrace_00.trc
    Correlator ID: 240496500000034715
    Argument Objects: 
    Arguments: 
    DSR Component: n.a.
    DSR Transaction: cb4b3560473711dd9fb4001e4f3b8fcb '
    Help me^^ plz..

    Hi Tanna.
    Thanks for your reply^^
    I create webservice that access my stored procedure.
    But not supported.
    http://dmp.humaxdigital.com/HumaxCmdwService/Service1.asmx?wsdl
    There are two service. (Hello World - Test, prcrelease_test - Stored Procedure )
    'Hello World' is supported but prcrelease_test is not supported. I can't drag to storyboard.
    Our company's DB is MSSQL2005.
    please help me^^

  • Publish PLSQL stored procedure as web services

    Is it true that PLSQL stored procedure can only be published as web services using JAVA?
    I came across article that mention how to call other web services from within plsql, but not sure the vice versa.
    So, please advise.
    Thank you.

    True..I've done it once using J-Developer.
    http://www.oracle.com/technology/obe/obe1013jdev/ws/wsandascontrol.htm#o
    Good luck!!
    Bhagat

  • Java stored procedure vs. PL-SQL vs. external java program

    Hi,
    I'm using a stored procedure for running a query and a few consequent updates. Currently I'm using Java stored procedure for that, which was my choice for simplicity on one hand, and running with the DB on the other.
    In my tests, strangely enough it came out that running as java stored procedure was 3-4 times slower than running as a java program outside the database. I don't know how to explain this, and I wonder if switching to PL/SQL will improve the performance of the code.
    Any experiences? recommendations?
    Thanks,
    Dawg

    In my tests, strangely enough it came out that running as java stored procedure was 3-4 times slower than running as a java program outside the database. I don't know how to explain this, and I wonder if switching to PL/SQL will improve the performance of the code.This isn't strange at all. See: Oracle's JVM (Aurora) is an independent Java Virtual Machine implementation, in accordance to specification. It implements all necessary parts of it (I think so). When you use an external JVM (I assume it's Sun's HotSpot JVM) you use completely different product. It is implemented in different way, it has many different code parts.
    One of the biggest differences between Oracle's JVM and Sun's JVM is [Just-in-Time compiler|http://en.wikipedia.org/wiki/Just-in-time_compilation]. Oracle has implemented it only in the 11g version of database, i.e. 2 years ago, while Sun performed it back in 2000 and continues to improve it for the last 9 years. That would explain obvious differences between Java program inside and outside the DB: they are executed in absolutely different worlds. Diffs could be up to 10x times or more - that's not unusual.
    If you are on 10g and want to compare performance of stored Java procedure vs external program, then you might use additional command-line instruction for external program to disable JIT:
    -XintPS. I wouldn't use Java for your task - that's a total overkill. Use simple SP instead.

  • Start with java stored procedure in SQLDeveloper

    Hi,
    i'm a newbe in writing PL/SQL stored procedures. Thats the reason to wont to write some java stored procedures for an ORACLE 10g. I'm using the SQLDeveloper. My Problem is: how can i start to write java stored procedures. Where have i to put them?
    Can somebody help me?
    10x
    cu nanostruct

    For Java Stored procedures you'll need to use JDeveloper. For SQL Developer, there is a viewlet and a tutorial on this page:
    http://www.oracle.com/technology/products/database/sql_developer/index.html
    Sue

  • Exposing/Publishing PL/SQL Stored Procs as Web Services

    Has anyone come up with a way to publish PL/SQL stored procedures as web services? Our team already has sufficient knowledge in deploying EJBs and exposing them as services but we're curious to see if we can create services without building and deploying an EJB as the provider mechanism.
    Any ideas/guidance are appreciated!

    In JDeveloper 10 you can do it. check that article
    But in 11g version they hide that option :(
    [some info|http://forums.oracle.com/forums/thread.jspa?messageID=3237164&#3237164]
    Edited by: August_ on Apr 19, 2009 11:52 PM

  • How may one increase JVM/Java Stored Procedure Perfomance?

    Hi all,
    my question: How can one increase the performance of the Oracle JVM, especially of Java Stored Procedures?
    I ask this because I did some performance analysis (and was horrified :):
    I have a static Java method that'll need an average 15 ms to return - when executed locally.
    The same code, uploaded to an Oracle10g instance and published as Java Stored Procedure will take awful *925 ms*.
    I measured both times from within the method as shown below:
    public class JSProc {
    public static void doSomething() {
    long start = System.currentTimeMillis();
    // now comes the '15 ms'-code
    long time = System.currentTimeMillis() - start;
    That way, I'm not including any call spec overhead, network communication or whatever into the 925 ms. All in all the above procedure call will take about 1200 to 1500 ms until it returns to the client...
    The hardware: both client/server computers have the same hardware, both use the JDK provided with the latest Oracle10g release; single difference: client is Win2K, server is Linux.
    I would be immensely grateful for your suggestions concerning the possibilities to increase the JVM performance...
    Greetings,
    Sam

    As Avi suggested, subsequent calls of the procedure within the same session will reduce the execution time down to 40 ms in my testing environment.
    But that doesn't change anything for the 'first call' - when I start a new client program that opens a new connection, the Java Stored Proc will again need about a second to return.
    I wrote the procedure now in PL/SQL - it will return in less than 30 ms, subsequent calls will return in less than a ms. Guess what I'll use :)
    I played around with the JAVA* configuration params, but, as expected, that doesn't change anything in terms of performance. According to documentation, it will only affect the amount of classes I can load into the server.
    I just read that Oracle creates a new "little" JVM for every session, and I imagine that there's lot of method intercepting and things (the ominous AOP-code) to ensure transaction security.
    That's why I come to the conclusion that I won't use Java Stored Procedures for classical "connect, execute, disconnect" client-server applications. It's like full braking on the freeway :)

  • SSL Connection from a Java Stored Procedure

    Hello.
    I have a Java stored procedure for sending emails, using the JavaMail API. I need to use gmails as the SMTP server. Google requires that emails sent from their servers must be sent through SSL and must be authenticated.
    I'm having trouble in achieving this. Monitoring all traffic sent from the oracle database server, I've noticed that there is a successful connection to google, and a few seconds later the host (where the oracle databse is at), sends a packet telling google to finish the transaction.
    I'm wondering if there is any configuration on this issue that needs to be done, or if it is a known Oracle limitation.
    I'm using oracle 10.2.0.1.0
    Thanks a lot.
    Sincerely,
    John.

    Hello.
    I have a Java stored procedure for sending emails, using the JavaMail API. I need to use gmails as the SMTP server. Google requires that emails sent from their servers must be sent through SSL and must be authenticated.
    I'm having trouble in achieving this. Monitoring all traffic sent from the oracle database server, I've noticed that there is a successful connection to google, and a few seconds later the host (where the oracle databse is at), sends a packet telling google to finish the transaction.
    I'm wondering if there is any configuration on this issue that needs to be done, or if it is a known Oracle limitation.
    I'm using oracle 10.2.0.1.0
    Thanks a lot.
    Sincerely,
    John.

  • HELP!!! Problem of Calling external Web Service from a Java Stored Procedur

    1.I read the topic on http://www.oracle.com/technology/sample_code/tech/java/jsp/samples/wsclient/Readme.html about Calling external Web Service from a Java Stored Procedur.
    2.After I import .jar to Oracle what is required by the topic,som error occued.
    Like: ORA-29521: javax/activation/ActivationDataFlavor class not found,
    ORA-29545: badly formed class.
    3.These is not enough .jar required on the topic? What can I do for ORA-29545: badly formed class?
    Thany you!

    Try this
    Re: HELP! Loading Java Classes into Oracle ERROR

  • 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.

  • Problem in running a java stored procedure&optimum settings for this needed

    hi
    we are using java stored procedures to read huge data from database tables and transfer them to another system.
    the procedure is running fine but it fails after transferring 60000 records, the execution of procedure here does not terminate but keeps running with out performing any data transfer....since it does not give any error it is difficult for us to know what the actual problem is !!!!!!
    i have checked the code many a time and i dont see any infinite loops in that code.
    please give any pointers on why this might be happening?
    please also give all the parameters which need to be taken care of while running a java stored procedure
    thanks
    regards
    asif

    But the same thing works fine with a jdbc program
    the table name is converted
    The same convert.transform method is being used to do the conversion
    please help
    ISQL is similar to SQL prompt inOracle
    it is like,
    ISQL>
    Regards
    khurram

  • How to write call specs for a java stored procedure that takes a nested obj

    Example Class :
    public class B {
    int number;
    String str;
    public class A {
    private B[] _childern;
    public B[] getChildern(){
    return _children
    public static void saveAll(A a) throws SQLException {
    B[] children = a.getChildern();
    for(int i=0; i<children.length; i++){
    saveChild(children);
    public static void saveChild(B ch)throws SQLException {
    // do something
    What would be the call specification for the method A.saveAll(A)? Your help will be apprecited.
    Thank you
    Ajmal

    In other words, How to pass a Java Object from a Java stored procedure to a Java client ???
    Hello,
    I don't know to deal with a Vector object that has been generated from a stored procedure.
    Should I create first in the JDBC client and pass it as argument to the procedure ?
    Thanks in advance. Here is an extract ...
    On the client side :
    <<
    Vector buffer = new Vector();
    CallableStatement call =
    con.prepareCall ("{call my_procedure_run (?, ?)}");
    call.registerOutParameter(2, java.sql.Types.JAVA_OBJECT );
    call.setString (1, "bla bla bla");
    call.setObject (2, buffer);
    call.execute ();
    buffer = (Vector)call.getObject (2);
    >On the Java stored procedure
    <<
    public class my_procedure
    public static void Run(String input_value, Vector buffer)
    // ??? Vector buffer = new Vector();
    try
    while ( true )
    buffer.addElement(...) ;
    catch(Exception ex) { }

  • CLASSPATH configuration for jsp (java stored procedures)

    Hi.
    I have a very simple question for you people.
    I don't know where to set up the CLASSPATH configuration on a HP-UX so that Aurora can see this include jar file and my java stored procedure can run correctly.
    Thanks a lot.
    Flavio Matiello

    The way global variables could be created using java classes is by using static variables.The class variable values are stored in the JVM's memory
    In Oracle8i Each session gets its own JVM & hence you cannot have a Java class variable which could
    span across sessions.
    Hope this helps

  • Problem of java stored procedure

    hi,
    now I use the oracle9i JDeveloper9.0.3.1 to develop java stored procedure and then publish it to oracle9i database.
    In the database I create PL/SQL procedure to invoke the java stored procedure.But I encounter the problem,that is ,when I run the PL/SQL procedure ,it throw the java.lang.NullPointerException ,while the java class,the java stored procedure can run correctly invoked by the main class of java.The code of the java stored procedure is as follows:
    import java.sql.*;
    import java.util.Properties;
    public class SQLServerEventDistribute
    public static void sqlServerSaveData(String hostName,String databaseName,String user,String password,String tableName,int x1,int y1,int x2,int y2,String ip)
    String url="",sql="",userName="",passwd="";
    Connection connection;
    Statement statement;
    url="jdbc:microsoft:sqlserver://"+hostName+":1433;DatabaseName="+databaseName+";User="+user+";Password="+password;
    sql="INSERT INTO "+tableName+" VALUES("+x1+","+y1+","+x2+","+y2+",'"+ip+"')";
    Properties property=new Properties();
    property.setProperty(userName,user);
    property.setProperty(passwd,password);
    try
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    // DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver());
    connection=DriverManager.getConnection(url,property);
    statement=connection.createStatement();
    statement.execute(sql);
    }catch(ClassNotFoundException connectSQLServerEx)
    System.out.println(connectSQLServerEx.getMessage());
    catch(SQLException connectSQLServerEx)
    System.out.println(connectSQLServerEx.getMessage()+connectSQLServerEx.getErrorCode());
    the main class is as follows:
    public class Test
    public static void main(String[] args)
    SQLServerEventDistribute.sqlServerSaveData("gsm","gsmd","sa","sa","IPBinding",11,45,24,21,"23.1.248.12");
    and the PL/SQL procedure is as follows:
    PROCEDURE TEST AS
    BEGIN
    SQLSERVERSAVEDATA('gsm','gsmd','sa','sa','IPBinding',11,45,24,21,'23.1.248.22');
    END;
    How can I deal with it?
    can you tell me?
    thanks

    Hi JavaQQ,
    This is just a guess, but I think you need to load the
    Micro$oft SQLServer JDBC driver into the Oracle
    database (using the "loadjava" utility).
    In any case, there are several ways -- apart from JDBC
    -- for accessing a different database from within an
    Oracle database. Have you tried searching the Oracle
    Web sites for suitable products?
    Hope this helps.
    Good Luck,
    Avi.abramia ,thank you very much.
    but I have load the Microsoft SQLServer JDBC driver into the Oracle database .
    When I debugged the PL/SQL procedure,the exception was thrown at line connection=DriverManager.getConnection(url,property);
    What's the problem with it?

  • APEX fails with Java stored procedure that creates a JDBC connection

    Hello!
    We are facing a strange problem since we have upgraded from Oracle 10g and Apache to Oracle 11g with Embedded Gateway.
    Here is what we do:
    ** APEXX calls a PL/SQL package function "OPEN_CONNECTION" that wraps a Java stored procedure called "openConnection".*
    FILE_READER_REMOTE_API.openConnection(user, password, host, port, service);
    ** The Java stored procedures "openConnection" opens a JDBC connection to an other database:*
    public class FileReaderRemote {
    private static Connection conn = null;
    private static DefaultContext remoteContext = null;
    public static void openConnection(String user, String password, String host, String port, String service) throws SQLException {
    // Load the Oracle JDBC driver
    DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
    java.util.Properties props = new java.util.Properties();
    props.put ("user", user);
    props.put ("password", password);
    //props.put ("database", "//" + host + ":" + port + "/" + service);
    props.put ("database", host + ":" + port + ":" + service);
    props.put("v$session.program", "FileReaderRemote2");
    // Connect to the database
    remoteContext = Oracle.getConnection("jdbc:oracle:thin:", props);
    This procedure used to work fine before the upgrade, but now we see the following:
    * It still works when called directly from TOAD or SQL*Plus, even under the user ANONYMOUS.
    * When called from APEX and the target database is Oracle 11g, it still works.
    * When called from APEX and the target database is Oracle 10g, it takes several minutes and we receive this error:
    *"Socket read timed out"*
    We have tested the following workaround:
    We have created a database link to our own database and called the stored procedure through that database link.
    FILE_READER_REMOTE_API.openConnection*@loopback*(user, password, host, port, service);
    This works, but is not really an option.
    I hope some one of you can explain this strange behaviour to me.
    Best regards,
    Matthias

    You wrote
    "Java stored procedures -- by definition - are stored in the 8i rdbms. !!"
    From the Oracle8i Java Stored Procedures Developer's Guide
    Release 8.1.5
    A64686-01
    "If you create Java class files on the client side, you can use loadjava to upload them into the RDBMS. Alternatively, you can upload Java source files and let the Aurora JVM compile them. In most cases, it is best to compile and debug programs on the client side, then upload the class files for final testing within the RDBMS"
    This means that you can create shared classes that are used on both the client and server side. The source does not need to reside within the server (according to their documentation). Please also note the following from the Oracle8i JDBC Developer's Guide and Reference Release 8.1.5 A64685-01 for using the getConnection() method on the server:
    "If you connect to the database with the DriverManager.getConnection() method, then use the connect string jdbc:oracle:kprb:. For example:
    DriverManager.getConnection("jdbc:oracle:kprb:");
    Note that you could include a user name and password in the string, but because you are connecting from the server, they would be ignored."
    So if you're coding a shared class that is to run on both the client and server side, you might do something like this:
    Connection conn =
    DriverManager.getConnection(
    System.getProperty("oracle.server.version") == null
    ? "jdbc:oracle:thin:@hostname:1521:ORCL"
    : "jdbc:oracle:kprb:"),
    "youruserid","yourpassword");
    As stated earlier, the userid and password are supposedly ignored for server connections retrieved in this manner. I haven't tried this yet, but it is documented by Oracle.
    Regards,
    Steve
    null

Maybe you are looking for