Database Procedure Calling by Using PreparedStatement and CallableStatement

Hi
We can execute Database Stored Procedure by using PreparedStatement and CallableStatement as well.Then what is the significance of having CallableStatement.
Please let me know the difference between these two Statement objects particularly in Stored Procedures Execution.
Thanks in advance
Basha007

A callable statement excecutes a stored procedure that's stored and run on the database server.
A prepared statement doesn't require a database stored procedure. It's parsed and cached by the JDBC driver, and allows you to specify parameters and bind values to them at runtime. Those are usually used in loop constructs where you want to repeatedly execute the same SQL with different values.
Not all RDBMS support stored procedures (e.g., MySQL), but every driver I've used allows PreparedStatements. - MOD

Similar Messages

  • Database connection pooling in ADF causing db procedure calls to use different transaction or session

    We have developed an application using JDev Version 11.1.2.1.0 and the database is oracle 11g EE.
    We have many database procedures or function calls from the model (AMImpl.java, VORowImpl.java) and the commit does not happen in the database and it happens from ADF. The database procedures are called in some valueChangeListnener and these procedures use the same transaction or session database session when called and update some records in some tables that are displayed in pages.
    We started using connection pooling recently in our ADF application,  -Djbo.doconnectionpooling=true -Djbo.txn.disconnect_level=1. When using connection pooling, we noticed that the database procedure calls use a different trasanction or different database session and the data or records that these procedures update is lost.
    After removing the connection pooling, we noticed that the procedures again started using the same transaction or same database session and was working fine.
    I want to know why this connnection pooling caused this issue and is there any fix for this when using connection pooling?

    Take a look at
    http://docs.oracle.com/cd/E15523_01/web.1111/b31974/bcampool.htm#CIHCHHEA
    What You May Need to Know About Database User State and jbo.doconnectionpooling = true
    As you can see:
    "At the end of the request when the application module is released back to the application module pool, that application module pool releases the JDBC connection it was using back to the database connection pool. It follows that with jbo.doconnectionpooling set to true the application module instance in the pool may have a completely different JDBC connection each time you check it out of the pool"
    So, the best you can do, is to revert jbo.doconnectionpooling to false.

  • Using PreparedStatement and the Oracle Error ORA-1000

    Hi,
    I have a question about PreparedStatement objects that is not so simple to explain for me. What I would like to know is: if I use a PreparedStatement following traditional and generic steps:
    1- PreparedStatement pStmt = Connection.prepareStatement(sQuery);
    2- pStmt.setXXX(i,j);
    n - pStmt.setXXX(i,j);
    n+1 - ResultSet rs = pStmt.executeQuery();
    n+2 - while(rs.next()){ ... retrive ResultSet data  ... }
    n+3 - rs.close()
    n+4 - back to point number 2
    and at the end (as you can see in the point numbered n+4), instead of closing the PreparedStatement pStmt using the close() method, I reuse the PreparedStatement pStmt comeing back to the point numebr 2 and setting again all its parameters with new values ... then ... what heppens in the Oracle database ? Has been the cursor (so the mamory area), associated to my PreparedStatement object pStmt, duplicated or is it the same ?
    I know that Java allows you to do this kind of operations with PreparedStatement, and I know that in tha Java Documentation is explained to follow this strategy to optimize the execution time because in this way the same PreparedStatement is precompiled and prepared only once. But if I do a for loop following the steps explained before, after many iterations I have the error "ORA-1000: maximum open cursors exceeded". This error is the reason of my question. Does this error means that it's mandatory to close a PreparedStatement always, otherwise if you reuse it without closing it then the corresponding database cursor will be duplicated ? If it is so, then I think this is a contradiction with official java documentation ...
    I'm using Oracle8i (version 8.1.7) and Oracle JDBC Thin Driver (Windows NT) for use with JDK 1.2.x. Moreover, in my database istance the parameter "maximum open cursor" is equal to 800 ...
    Thank you very much for suggestions :-)

    There is no need to close a prepared statement or its resultset for every iteration.
    After the first iteration in a loop, all subsequent executions of it will close the previous resultset. By adding close() method, you are making one extra costly call to the DB for no reason.
    Following is the sample code.I know what you are saying. In fact at the beginning I wrote my code in the same way of your sample (see the code of my first post at the begin of this page).
    But doing so, after thousand iterations of the loop, I had "Oracle Error ORA-1000 : maximun open cursor exeeded" even if in my database istance the parameter "maximum open cursor" is equal to 8000.
    At this moment in my code, for each iteration, I close the PreparedStatement and in this way I don't have anymore the error :-((
    So it seems that only in theory we can reuse a preparedStatement without closing it. In fact if we see the oracle system table "$open_cursor" (as Konrad Pietzka suggest me) we can find that, for each interation,
    at our line code "rs = pstmt.executeQuery();" correspond a new cursor in the database: this means that for each method "pstmt.executeQuery()" the database open a new cursor and do not use the previous one as it should.
    I posted a question two months ago to search if someone had the same problem (it seems that Konrad Pietzka had the same situation) and was able to explain me what is the cause.
    The only reason I found by myself for this problem, is that probably the Oracle JDBC Thin Driver for Windows NT/2000 has some bugs... but I'm not sure ...
    Thank you very much for you time !!
    bye :-))
    Fidalma

  • Database procedure called from Forms

    If a database procedure that updates a table is called from Oracle Forms, does it commit the changes automatically or do you have to issue a commit in Forms to commit the changes the database procedure has done, assumming there is no commits in the database procedure.
    I'm not sure since I have seen cases where a commit was needed after the database procedure has been called and a case where a commit was needed. I checked the database procedure and there was no commits, there was a commit above the statement where the procedure was being called.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by NAB ():
    If a database procedure that updates a table is called from Oracle Forms, does it commit the changes automatically or do you have to issue a commit in Forms to commit the changes the database procedure has done, assumming there is no commits in the database procedure.
    I'm not sure since I have seen cases where a commit was needed after the database procedure has been called and a case where a commit was needed. I checked the database procedure and there was no commits, there was a commit above the statement where the procedure was being called.<HR></BLOCKQUOTE>
    Database procedure do have commit. You can issue commit in the procedure itself.
    null

  • Somehow ejbCreate method of an Entity EJB is not inserting a record into the database. I'm using BMP and calling the Entity bean method from a servlet. I'm using NAS 4.0 sp5 on Win 2k.

    Also if I call the insert query from within the servlet it works fine. I have disabled global transactions. Am I missing something out ? Please
    any help would be greatly appreciated.

    May be your servlet is not able to lookup the EJB. You can use some print statements and see whether lookup ok or not.
    Just a guess.
    Plese get back, if any queries.
    Thanks,
    Rakesh.

  • Problem in using BLOB and callablestatement

    Hi
    I am doing an insert into the database , of which one of the clomn is
    BLOB
    when i do it using prepared statement , it does it fine
    but if i do it using the callable statment (Stored procedure)its not
    doing it .....
    and gives an error like below
    does anybod know what the problem is
    java.sql.SQLException: ORA-06550: line 1, column 9:
    PLS-00306: wrong number or types of arguments in call to 'IN
    SERT_EVENT_LOG'
    ORA-06550: line 1, column 9:
    PL/SQL: Statement ignored
    at weblogic.db.oci.OciCursor.getCDAException(OciCurs
    or.java:228)
    at weblogic.jdbcbase.oci.Statement.executeUpdate(Sta
    tement.java:869)
    at weblogic.jdbc20.pool.PreparedStatement.executeUpd
    ate(PreparedStatement.java:47)
    at weblogic.jdbc20.rmi.internal.PreparedStatementImp
    l.executeUpdate(PreparedStatementImpl.java:54)
    at weblogic.jdbc20.rmi.SerialPreparedStatement.execu
    teUpdate(SerialPreparedStatement.java:55)
    at com.expertcommerce.core.log.DatabaseLogService.in
    ternalLog(DatabaseLogService.java:73)
    at com.expertcommerce.core.log.BaseLogService.log(Ba
    seLogService.java:33)
    at com.expertcommerce.core.log.biz.ServerLogAdapter.
    log(ServerLogAdapter.java:113)
    at com.expertcommerce.core.log.biz.ServerLogAdapter.
    logError(ServerLogAdapter.java:135)
    at com.expertcommerce.core.users.biz.UserEntityBean.
    ejbFindByPrimaryKey(UserEntityBean.java:409)
    at com.expertcommerce.core.users.biz.UserEntityBeanH
    omeImpl.findByPrimaryKey(UserEntityBeanHomeImpl.java:81)
    at com.expertcommerce.core.users.biz.UserEntityBeanH
    omeImpl.findByPrimaryKey(UserEntityBeanHomeImpl.java:49)
    at weblogic.ejb.internal.EJBHomeImpl.remove(EJBHomeI
    mpl.java:297)
    at com.expertcommerce.core.users.biz.UserEntityBeanH
    omeImpl_ServiceStub.remove(UserEntityBeanHomeImpl_ServiceStu
    b.java:378)
    at com.expertcommerce.core.users.biz.UserManagerSess
    ionBean.removeUser(UserManagerSessionBean.java:172)
    at com.expertcommerce.core.users.biz.UserManagerSess
    ionBean.handle(UserManagerSessionBean.java:47)
    at com.expertcommerce.core.users.biz.UserManagerSess
    ionBeanEOImpl.handle(UserManagerSessionBeanEOImpl.java:146)
    at com.expertcommerce.core.users.biz.UserManagerSess
    ionBeanEOImpl_ServiceStub.handle(UserManagerSessionBeanEOImp
    l_ServiceStub.java:255)
    at com.expertcommerce.core.event.CoreEventDispatcher
    .dispatch(CoreEventDispatcher.java:17)
    at com.expertcommerce.core.event.biz.CoreEventDispat
    cherSessionBean.dispatch(CoreEventDispatcherSessionBean.java
    :24)
    at com.expertcommerce.core.event.biz.CoreEventDispat
    cherSessionBeanEOImpl.dispatch(CoreEventDispatcherSessionBea
    nEOImpl.java:105)
    at com.expertcommerce.core.event.biz.CoreEventDispat
    cherSessionBeanEOImpl_WLSkel.invoke(CoreEventDispatcherSessi
    onBeanEOImpl_WLSkel.java:159)
    at weblogic.rmi.extensions.BasicServerObjectAdapter.
    invoke(BasicServerObjectAdapter.java:338)
    at weblogic.rmi.extensions.BasicRequestHandler.handl
    eRequest(BasicRequestHandler.java:69)
    at weblogic.rmi.internal.BasicExecuteRequest.execute
    (BasicExecuteRequest.java:15)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.j
    ava:120)
    com.expertcommerce.core.log.LogServiceException: ORA-06550:
    line 1, column 9:
    PLS-00306: wrong number or types of arguments in call to 'IN
    SERT_EVENT_LOG'
    ORA-06550: line 1, column 9:
    PL/SQL: Statement ignored
    at com.expertcommerce.core.log.DatabaseLogService.in
    ternalLog(DatabaseLogService.java:111)
    at com.expertcommerce.core.log.BaseLogService.log(Ba
    seLogService.java:33)
    at com.expertcommerce.core.log.biz.ServerLogAdapter.
    log(ServerLogAdapter.java:113)
    at com.expertcommerce.core.log.biz.ServerLogAdapter.
    logError(ServerLogAdapter.java:135)
    at com.expertcommerce.core.users.biz.UserEntityBean.
    ejbFindByPrimaryKey(UserEntityBean.java:409)
    at com.expertcommerce.core.users.biz.UserEntityBeanH
    omeImpl.findByPrimaryKey(UserEntityBeanHomeImpl.java:81)
    at com.expertcommerce.core.users.biz.UserEntityBeanH
    omeImpl.findByPrimaryKey(UserEntityBeanHomeImpl.java:49)
    at weblogic.ejb.internal.EJBHomeImpl.remove(EJBHomeI
    mpl.java:297)
    at com.expertcommerce.core.users.biz.UserEntityBeanH
    omeImpl_ServiceStub.remove(UserEntityBeanHomeImpl_ServiceStu
    b.java:378)
    at com.expertcommerce.core.users.biz.UserManagerSess
    ionBean.removeUser(UserManagerSessionBean.java:172)
    at com.expertcommerce.core.users.biz.UserManagerSess
    ionBean.handle(UserManagerSessionBean.java:47)
    at com.expertcommerce.core.users.biz.UserManagerSess
    ionBeanEOImpl.handle(UserManagerSessionBeanEOImpl.java:146)
    at com.expertcommerce.core.users.biz.UserManagerSess
    ionBeanEOImpl_ServiceStub.handle(UserManagerSessionBeanEOImp
    l_ServiceStub.java:255)
    at com.expertcommerce.core.event.CoreEventDispatcher
    .dispatch(CoreEventDispatcher.java:17)
    at com.expertcommerce.core.event.biz.CoreEventDispat
    cherSessionBean.dispatch(CoreEventDispatcherSessionBean.java
    :24)
    at com.expertcommerce.core.event.biz.CoreEventDispat
    cherSessionBeanEOImpl.dispatch(CoreEventDispatcherSessionBea
    nEOImpl.java:105)
    at com.expertcommerce.core.event.biz.CoreEventDispat
    cherSessionBeanEOImpl_WLSkel.invoke(CoreEventDispatcherSessi
    onBeanEOImpl_WLSkel.java:159)
    at weblogic.rmi.extensions.BasicServerObjectAdapter.
    invoke(BasicServerObjectAdapter.java:338)
    at weblogic.rmi.extensions.BasicRequestHandler.handl
    eRequest(BasicRequestHandler.java:69)
    at weblogic.rmi.internal.BasicExecuteRequest.execute
    (BasicExecuteRequest.java:15)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.j
    ava:120)
    with parameter
    exitsfalse
    Retuening result to CoreEventcom.expertcommerce.core.users.e
    vents.RemoveUserEvent@6dcc33
    Stored Procedure .....
    CREATE or replace procedure insert_Event_Log
    pEvent_ID in out number,
    pEvent_Severity in number,
    pEvent_Data in blob,
    pEvent_Action in number,
    pEvent_Time in date,
    pEvent_Source in char,
    pEvent_Status in char,
    pEvent_User in char,
    pEvent_Subject in char,
    pEvent_Subject_ID in char
    AS
    tEvent_ID number;
    BEGIN
    /* Get the sequence key */
    if (pEvent_ID is null ) then
    select event_id_seq.nextval into tEvent_ID from dual;
    insert into Event_ID (pkey, justabit) values ( tEvent_ID, 1);
    end if;
    /* Insert the values in the table */
    INSERT INTO Event_Log
    Event_ID,
    Event_Severity,
    Event_Data,
    Event_Action,
    Event_Time,
    Event_Source,
    Event_Status,
    Event_User,
    Event_Subject,
    Event_Subject_ID
    VALUES (
    tEvent_ID,
    pEvent_Severity,
    pEvent_Data,
    pEvent_Action,
    pEvent_Time,
    pEvent_Source,
    pEvent_Status,
    pEvent_User,
    pEvent_Subject,
    pEvent_Subject_ID
    pEvent_ID := tEvent_ID;
    END;
    My TEst Program
    import java.sql.*;
    import java.util.Properties;
    import oracle.jdbc.driver.*;
    import oracle.sql.*;
    class rfxtest{
    public static void main(String[] args){
    rfxtest test = new rfxtest();
    CallableStatement m_stmt = null;
    PreparedStatement pStmt = null;
    String rfxdata = "this is the test data for the event-blob-test";
    try{
    Connection con = test.getConnection();
    String temp = "call insert_event_log ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
    m_stmt = con.prepareCall(temp);
    m_stmt.setNull(1, java.sql.Types.INTEGER);
    m_stmt.setInt(2, 123);
    m_stmt.setBytes(3, (byte[])rfxdata.getBytes());
    m_stmt.setInt(4, 123);
    m_stmt.setTimestamp(5, new java.sql.Timestamp(System.currentTimeMillis()));
    m_stmt.setString(6, "xxxxxxxxxx");
    m_stmt.setString(7, "xxxxxxxxxx");
    m_stmt.setString(8, "xxxxxxxxxx");
    m_stmt.setString(9, "xxxxxxxxxx");
    m_stmt.setString(10, "xxxxxxxxxx");
    m_stmt.executeUpdate();
    String selectStmt = " select event_data from event_log where event_id = 12345" ;
    pStmt = con.prepareStatement(selectStmt);
    ResultSet rs = pStmt.executeQuery();
    if(!rs.next()){
    System.out.println("error");
    } else {
    Blob b = rs.getBlob(1);
    byte[] blob = (byte[])b.getBytes(1,(int)b.length());
    String s = new String(blob);
    System.out.println("The blob content is : "+s);
    }catch(Exception e){
    e.printStackTrace();
    public Connection getConnection(){
    try{
    Properties props = new Properties();
    props.put("user", "nexgen");
    props.put("password", "nexgen");
    Driver myDriver = (Driver) new oracle.jdbc.driver.OracleDriver();
    Connection conn =
    myDriver.connect("jdbc:oracle:thin:@192.168.254.6:1521:ecw",props);
    return conn;
    catch(Exception e){
    e.printStackTrace();
    return null;
    appreciate response
    venki
    null

    Navid,
    JHeadstart checks whether the attribute definition is queryable before adding it to the list of advanced search attributes. A transient VO attribute can still be set to queryable, for a transient EO attribute this is not possible. We will remove this check on queryability in the upcoming patch release, since you have a valid use case. For now, you can subclass JhsSearchBean and override method createArgumentListForAdvancedSearch and comment out the check for "def.isQueryable()".
    Steven Davelaar,
    JHeadstart Team.

  • A database procedure call takes a long time but user is okay with that

    Is there a way of showing to the user a progress bar type WITHOUT using javabeans to indicate the status of a database process ? I think there is a timer of some description, can anyone post sample code please.
    The user is fine that a process will can take up to 10 minutes to run. (it is a batch processing routine and involves many other procedures, etc in the database to run)
    I am running:
    Forms [32 Bit] Version 10.1.2.3.0 (Production)
    Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - Production
    With the Partitioning and Data Mining options
    Oracle Toolkit Version 10.1.2.0.2 (Production)
    PL/SQL Version 10.1.0.5.0 (Production)
    Oracle Procedure Builder V10.1.2.3.0 - Production
    PL/SQL Editor (c) WinMain Software (www.winmain.com), v1.0 (Production)
    Oracle Query Builder 10.1.2.3.0 - Production
    Oracle Virtual Graphics System Version 10.1.2.0.2 (Production)
    Oracle Tools GUI Utilities Version 10.1.2.0.2 (Production)
    Oracle Multimedia Version 10.1.2.0.2 (Production)
    Oracle Tools Integration Version 10.1.2.0.2 (Production)
    Oracle Tools Common Area Version 10.1.2.0.2
    Oracle CORE     10.1.0.5.0     Production

    Create an item which width is 100%, change the visual properties to show it like a bar.
    Show it on separate window with a separate canvas.
    Create a procedure which:
    - Change the length of your bar:
    SET_ITEM_PROPERTY('<Your bar item>', WIDTH, <Width of your bar item> * <Percent of the bar to show> / 100);
    - shows the window in front
    SHOW_WINDOW('<Your window>');
    - hide the window if <Percent of the bar to show> is greater or equal 100
    HIDE_WINDOW('<Your window>');

  • Call Webservice using REST and not SOAP

    Hi, I am looking for an example of calling (invoking) a webservice from the database using PLSQL. The webservice is using REST rather than SOAP and returning XML
    I have already got examples of how to call a webservice using SOAP but not for REST
    Regards
    Ash

    Using Fiddler while loading your WSDL in a browser, I can see that the WSDL is using HTTP Chunked encoding. You should configure JBoss to return the WSDL without chunked encoding.

  • How to write from database to XML file using JAVA and back..

    Hi....
    I am strugling for a code to write from database to xml output instead of what i have written in flat file....could anyone please help me out...to do this and again read the same back to the database using java...

    Hi,
    In java world, there is a tutorial on what you are looking for :
    http://www.javaworld.com/javaworld/jw-01-2000/jw-01-dbxml_p.html
    It uses SAX/DOM parsers to translate XML data into the appropriate fields of the database and visa-versa.
    Hope it helps.

  • Calling stored procedure from VB using OraOLEDB.Oracle

    I have a simple stored procedure with two parameters:
    PROCEDURE Test1(
         pOutRecords OUT tCursorRef,
         pIdNumber IN NUMBER);
    where tCursorRef is REF CURSOR.
    (This procedure is part of a package with REF CURSOR declared in there)
    And I have two database schemas: AppOwner and AppUser.
    The above stored procedure is owned by AppOwner, but I have to execute this stored procedure from AppUser schema. I have created a private synonym and granted the neccessary privileges for AppUser schema to execute the package in the AppUser schema.
    When I ran the above procedure from VB using ADO and OraOLEDB.Oracle.1 driver, I got the following error when connecting to the AppUser schema:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'TEST1'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    but when I was connecting to the AppOwner schema, everything is running correctly without errors.
    Also, when I switch to the microsoft MSDAORA.1 driver, I can execute the above procedure without any problems even when connecting to the AppUser schema.
    I got this error only when I am trying to execute a stored procedure with an output parameter. All other procedures with only input parameters have no problems at all.
    Do you know the reason for that? Thanks!

    This forum is meant for discussions about OTN content/site and services.
    Questions about Oracle products and technologies will NOT be answered in this forum. Please post your product or technology related questions in the appropriate product or technology forums, which are monitored by Oracle product managers.
    Product forums:
    http://forums.oracle.com/forums/index.jsp?cat=9
    Technology forums:
    http://forums.oracle.com/forums/index.jsp?cat=10

  • Reading using Stored Procedure Calls

    Hi All,
                I have a scenario where I need to read data froma table and post it to ECC. A stored procedure call is used to generate the data from the database. How do I handle this in sender JDBC adapter?
    XIer

    Hey
    there are some restrictions on executing stored procedures for Oracle,anyways have a look at the following blog
    /people/jegathees.waran/blog/2007/03/02/oracle-table-functions-and-jdbc-sender-adapter
    Thanx
    Aamir suhail

  • Use Preparedstatement to delete several rows from database

    Hello everyone,
    I am trying to delete multiple rows from database at one time using Preparedstatement.
    It works well when I tried in SQL directly,the sql query is as follows:
    delete from planners_offices where planner ='somename' and office in ( 'officeone', 'officetwo', 'officethree')
    I want to delete those 3 rows at one time.
    But when I am using preparedstatement to implement this function, it does not work. It did not throw any exception, but just does not work for me, the updated rows value always returns "0".
    Here is my simplified code:
    PreparedStatement ps = null;
    sqlStr = " delete from PLANNERS_OFFICES where planner = ? and office in (?) "
    Connection con = this.getConnection(dbname);
    try
    //set the sql statement into the preparedstatement
    ps = con.prepareStatement(sqlStr);
    ps.setString(1,"somename");
    ps.setString(2,"'officeone','officetwo','officethree'");
    int rowsUpdated =ps.executeUpdate();
    System.out.println(rowsUpdated);
    //catch exception
    catch (SQLException e)
    System.out.println("SQL Error: " + sqlStr);
    e.printStackTrace();
    catch (Exception e) {
    e.printStackTrace();
    } finally {
    this.releaseConnection(dbname, con);
    try{
    ps.close();
    }catch (SQLException e){
    e.printStackTrace();
    rowsUpdated always give me "0".
    I tried only delete one record at one time, "ps.setString(2, "officeone");", it works fine.
    I am guessing the second value I want to bind to the preparedstatement is not right, I tried several formats of that string, it does not work either.
    Can anyone give me a clue?
    Thanks in advance !
    Rachel

    the setString function in a preparedStatement doesn't just do a replace with the question mark. It is doing some internal mumbojumbo(technical term) to assign your variable to the ?.
    If you are looking to do your statement, then you will need to put in the correct of # of question marks as you need for the in clause.
    delete from PLANNERS_OFFICES WHERE PLANNER = ? and office in (?,?,?)
    If you need to allow for one or more parameters in your in clause, then you will need to build your SQL dynamically before creating your prepared statement.
    ArrayList listOfOfficesToDelete ;
    StringBuffer buffer = new StringBuffer("DELETE FROM PLANNERS_OFFICES WHERE PLANNER = ? AND OFFICE IN (");
    for(int i = 0; i < listOfOfficesToDelete.size(); i++ )
       if( i != 0 )
           buffer.append(",");
       buffer.append("?");
    buffer.append(")");
    cursor = conn.prepareStatement( buffer.toString() );
    cursor.setString(1, plannerObj);
    for(int i = 0; i < listOfOfficesToDelete().size(); i++ )
        cursor.setString(i+1, listOfOfficesToDelete.get(i) );
    cursor.executeUpdate() ;

  • How to write SDO_GEOMETRY using PreparedStatements ?

    Hi there,
    I use JDBC and JDK 1.3+
    Currently I'm writing geometries into Spatial by using Strings and
    I meet some limitations for very huge geometries.
    That's why I need to use PreparedStatements and parameters to get
    rid of this limitation.
    My question is how can I write Object types by using JDBC. All
    the sample codes I found use oracle.sql and oracle.jdbc packages.
    My problem is that my code can be used by people that may not
    have an Oracle jdbc driver like "thin" for instance.
    thanks for your help,
    ALI

    Justin,
    I have a PL/SQL package that contains several functions. One of them does selection and filtering of spatial features based on a user's location and preferences. For this purpose a web-application runs this function.
    I would like this function to do the following:
    1. the function is called, user parameters are passed in
    2. a call to a java-stored-procedure is made. This java procedure creates a polygon based on the user's location and preferences.
    3. the polygon is returned to the PL/SQL function
    4. the funtion uses the returned polygon to query spatial features that intersect, etc.
    I can do the call to the java-stored-procedure but where I get stuck is how to get the polygon from java to pl/sql. I can return a String or a number from java but how can I return the polygon (e.g., STRUCT, java object)?
    The current solution uses a work-around by storing the polygon in a temporary table. I would like to change this because once the function has run, the polygon is not needed anymore so I would like to do without having to store the polygon.
    Markus

  • CAN I PASS FORM VARIABLES TO THE DATABASE PROCEDURE IN PERSONALIZATION

    When I try to use form variable in the database procedure call from personalization I get the attached error.
    Under forms personalization
    From Actions tab --> builtin --> Execute Procedure when I call a database procedure and pass one of the form variable as parameter I get "ora-01008 couldn't be validate" error
    Can we pass on form variables to the database package using personalization ? If yes, then is this the right way?
    Message was edited by:
    omitchel

    I tried customizing the Quoting Form, it works.
    What you have done is correct, but this is how you call it
    ='begin
    db_proc('''||${item.qothddet_main.quote_name.value}||''');
    end'
    here
    qothddet_main : block name
    quote_name : item name
    Thanks
    Tapash

  • Show the result of execution of a database procedure

    Hi everyone,
    I want to execute an oracle database procedure in oracle forms environment and show the result of execution to user(as "procedure executed successfully".. etc) How can I achieve this ?
    Thanks..

    That would depend on the implementation of your procedure. I would say if there is no exception thrown then the procedure completed successfully. Of course there might be some additional conditions when you consider your procedure run successful.
    So in the end you have to design your procedure so the caller can recognize if the procedure run successful or not. How you want to do this is up to you; you can use user defined exceptions (raise_application_error) if an error in your logic occurs which is not a default oracle exceptions, functions which return booleans or output stati.
    I for one prefer exceptions, as they force the caller to handle them (I add the user-defined exceptions thrown by each procedure in the specification right to the documentation so the one using my procedure sees it right away) and ensure my procedure is atomic.
    But as said this is entirely up to you.
    cheers

Maybe you are looking for

  • Credit Memo Details in CRM_ORDER_READ

    Hi All, I have to read the credit memo details for a particular Opportunity.  For this can anyone let me know through which export parameter of FM CRM_ORDER_READ, we can find the Creadit Memo details of an Opportunity. Regards, Vinny

  • Error "602" System error: AK Datapart too short

    Hi all, Ok, I have looked just about everywhere for an answer to this but to no avail...I even tried under a few rocks we have laying around. Anyway here it is: While running a compression in BW we get Error "602"  System error: AK Datapart too short

  • FITE_EXPENSES  -- Available Travel Requests / Plans

    Hi Experts, I've got a question concerning the creation of travel expenses and the data acquisition of the respective travel request. Let's say I've sent a Travel Request and it has been approved by the respective approver, i.e. status of the process

  • ADF and Oracle Apps

    I have heard that OAF is much better for Oracle Apps related work than ADF. Is that true? Can ADF work with Oracle Apps better than OAF?

  • QuickTime problem or iMove problem?

    QuickTime or iMove problem? I have an iMac G5, 1,8 GHz, 1,25 GB RAM. Initially I had Tiger, now Leopard is installed. Playback from iMove is slow and the same applies any file played with QuickTime. There is a temporarily solution in iMovie: I connec