Error executing a callable statement on a pooled connection

Hi,
I have an Oracle function that returns a number:
create or replace function
S2B_STOP_STAGE (DOC_ID number, ST_ID number)
return number ...
and the following Java code:
Class.forName("weblogic.jdbc.pool.Driver").newInstance();
conn = DriverManager.getConnection("jdbc:weblogic:pool:madrigalPool");
String sql = "{? = call S2B_STOP_STAGE(401,1002)}";
CallableStatement stmt = conn.prepareCall(sql);
stmt.registerOutParameter(1, Types.INTEGER);
stmt.execute(sql);
res = stmt.getInt(1);
When the execute(sql) statement is executed, a SQLException is thrown:
java.sql.SQLException: ORA-01008: not all variables bound
at weblogic.jdbc.pool.PreparedStatement.execute(PreparedStatement.java:121)
Does anybody have an idea about what may be wrong? I am using Oracle
8.1.6, the thin driver classes12-81620.zip, and WebLogic 6.0 sp2.
Thanks,
Vladimir

I found out what was wrong. I should have used execute() instead of execute(sql)
on the callable statement...
Sorry for the problem.
Vladimir
"vladimir" <[email protected]> wrote:
>
Hi,
I have an Oracle function that returns a number:
create or replace function
S2B_STOP_STAGE (DOC_ID number, ST_ID number)
return number ...
and the following Java code:
Class.forName("weblogic.jdbc.pool.Driver").newInstance();
conn = DriverManager.getConnection("jdbc:weblogic:pool:madrigalPool");
String sql = "{? = call S2B_STOP_STAGE(401,1002)}";
CallableStatement stmt = conn.prepareCall(sql);
stmt.registerOutParameter(1, Types.INTEGER);
stmt.execute(sql);
res = stmt.getInt(1);
When the execute(sql) statement is executed, a SQLException is thrown:
java.sql.SQLException: ORA-01008: not all variables bound
at weblogic.jdbc.pool.PreparedStatement.execute(PreparedStatement.java:121)
Does anybody have an idea about what may be wrong? I am using Oracle
8.1.6, the thin driver classes12-81620.zip, and WebLogic 6.0 sp2.
Thanks,
Vladimir

Similar Messages

  • Error: 28005, Severity: 16, State: 2...An exception occurred while enqueueing a message in the target queue. Error: 15517, State: 1. Cannot execute as the database principal because the principal "dbo" does not exist, this type of principal cannot be impe

    I've seen some similar questions, but want to make sure I can get an answer quickly and how to fix.
    Thanks,
    Paul
    spid24s     Error: 28005, Severity: 16, State: 2
    spid24s     An exception occurred while enqueueing a message in the target queue. Error: 15517, State: 1. Cannot execute as the database principal because the principal "dbo" does not exist, this type of principal cannot be impersonated,
    or you do not have permission.

    Hi Paul,
    I also had the same error on one of my servers, and it was because the user that created the database no longer worked for the company.
    So when his AD account got deleted, the database had NULL as owner
    Using the following query I asked for the owners of the databases:
    select name, suser_sname(sid) from master.dbo.sysdatabases
    So changing the owner of the databases that had a NULL owner solved the issue for me.
    use <databasesname>
    go
    exec sp_changedbowner 'sa'
    Thanks for triggering the solution.
    Peter

  • What may be the cause of this error java.sql.SQLException: invalid sql type passed to callable statement in iplanet ussing JNDI

     

    Hi,
    The possibilities can be of various reasons, with the sql statements,
    xml descriptors, data sources, improper drivers anything. To crack down
    the solution, kindly let me know the error messages and what exactly are
    you trying to accomplish.
    Thanks & Regards
    Raj
    manimaran t wrote:
    what may be the cause of this error java.sql.SQLException: invalid sql
    type passed to callable statement in iplanet ussing JNDI
    Try our New Web Based Forum at http://softwareforum.sun.com
    Includes Access to our Product Knowledge Base!

  • Error executing SQL statement

    Hi,
    Can anyone see why I am getting this error message for my SQL query?
    WITH SKU_DATA AS (
    SELECT /*+ MATERIALIZE */ DISTINCT FROM_LOC_ID,
               SKU_ID,
               DESCRIPTION,
               UPDATE_QTY,
            ORDER_ID,
            CONSIGNMENT,
               WEIGHT,
            PALLET_ID,
            CASE 
        WHEN Upd_Qty_Ratio < 1
        THEN TO_CHAR(UPDATE_QTY) || 'U'
        WHEN TRUNC(Upd_Qty_Ratio) = Upd_Qty_Ratio
        THEN TO_CHAR(Upd_Qty_Ratio) || 'C'
        ELSE TO_CHAR(TRUNC(UPDATE_QTY)) || 'C' || ' ' || TO_CHAR(ROUND(MOD(Upd_Qty_Ratio, 1) *  USER_DEF_NUM_3, 6)) || 'U'
        END CU_Sum
        FROM (
      SELECT DISTINCT
             FROM_LOC_ID,
          S.SKU_ID,
             S.DESCRIPTION,
             ITL.UPDATE_QTY,
             S.USER_DEF_NUM_3,
          OH.ORDER_ID,
          ITL.CONSIGNMENT,
          ITL.PALLET_ID,
             NVL(ITL.UPDATE_QTY,0)*NVL(S.EACH_WEIGHT,0) Weight,
             ITL.UPDATE_QTY/(CASE S.USER_DEF_NUM_3 WHEN 0 THEN 1 ELSE S.USER_DEF_NUM_3 END) Upd_Qty_Ratio
        FROM INVENTORY_TRANSACTION ITL, SKU S, LOCATION L, ORDER_HEADER OH
        WHERE ITL.SKU_ID = S.SKU_ID
        AND ITL.CODE = 'Pick'
        AND ITL.CONSIGNMENT = $P{Consignment}
        AND OH.ORDER_DATE = TO_CHAR($P{Date}, 'DD-Mon-YYYY')
        AND OH.ORDER_ID = ITL.REFERENCE_ID
        AND ITL.TO_LOC_ID = 'CONTAINER'))
    SELECT DISTINCT ORDER_ID, CONSIGNMENT, WEIGHT, PALLET_ID, CU_Sum,
    (SELECT NVL(TO_CHAR(SUM(CASE WHEN NULLIF(SUBSTR(Cu_Sum, -1), 'U') IS NULL THEN NULL ELSE REPLACE(Cu_Sum,'C',NULL) END)),'0') ||'C' || ' ' || NVL(TO_CHAR(SUM(CASE WHEN NULLIF(SUBSTR(Cu_Sum, -1), 'C') IS NULL THEN NULL ELSE REPLACE(Cu_Sum,'U',NULL) END)),'0') ||'U' FROM SKU_DATA) AS Total_Cu_Sum
    FROM SKU_DATAThanks in advance.
    SM.

    Hi Sean,
    It is saying error executing SQL statement, but with no "ORA error" so maybe its a Jasper Reports error i'm not too sure.
    And this is a different version of the one we done together, that one is running fine just having problems putting the jasper file on to the server. I'm just using the main bits from the original SQL.
    SM

  • Err 62007: SQL Error: 99999 ORA-24338: Statement Handle not Executed

    Hi,
    I am facing a problem while adding a new parameter n my JSP Report JDBC query based on a ref-cursor from a stored procedure define in a package in database.
    No problem at database level, I have added the new parameter in package specification and Package body for that procedure and compile my package, it complies without any error and warning.
    but when I open the report and add parameter in the report JDBC query window, then it is generating a error message,
    "Err 62007: SQL Error: 99999 ORA-24338: Statement Handle not Executed "
    and I am unable to add the new parameter in report.
    e.g.
    Actual which was working is:
    My-package.My-procedure(:P1,:P2,:P3 ,:P4,:P5,:P6,:P7)
    I want to do this:
    My-package.My-procedure(:P1,:P2,:P3 ,:P4,:P5,:P6,:P7,:P8)
    but unable to do due to this error message:
    ("Err 62007: SQL Error: 99999 ORA-24338: Statement Handle not Executed ")
    Reports Builder 10g:
    Database 10g:
    Operating system windows XP:
    using JDBC Query base on ref-cursor coming from the stored procedure define in the Package.
    Regards,
    Khan

    and compile my package, it complies without any error and warning.That doesn't mean anything in this case. You are getting a runtime error, not a compilation error. The error is coming when you execute your procedure.
    Did you test your modified procedure in sqlplus or SQL Developer?

  • Executing the SQL statement is not allowed - Error

    I am getting "Executing the SQL statement is not allowed" for an INSERT cfquery that I'm running.  I checked the usual suspects:
    - DSN allows INSERT
    - I've seen reports online where certain field names or values are considered key words, so for protection CF blocks the query in this way (it would be nice if there was a different error message when it gets blocked this way vs. the DSN doesn't allow INSERT error message).  The field names and values were all benign strings, so it didn't seem like that.
    I took the same string for the query and ran it on another page and it ran fine (same DSN, too).

    SOLVED: I decided to enter this in here, just to get it into web searches for others since I couldn't find anything.
    - I was calling a function for one of the values in the query:  get_db_status_code("initialize")  Apparently CF parses the query to see if it's allowed BEFORE it runs the CFML in it, so something in that function name, or the parameter "initialize" was a key word that CF doesn't allow.  I moved the function call outside of the query and loaded a temp variable for use in the query and it then worked.

  • MDM Database command execution error. A SQL statement failed to execute

    Hi,
    When we tried to execute an MDM Java query modify/create, we get the following dump.
    Is this anything to do with the parameters that we pass or is it something to do with the database ?
    We have checked the code and we do not find anything wrong with the code at all.
    We are using Java API 5.5.63.73 and calling MDM API's using WebDynpro for Java.
    I have noticed this issue has been raised here as well :
    Database command execution error. (While mounting a repository)
    com.sap.mdm.commands.CommandException:
    com.sap.mdm.internal.protocol.manual.ServerException: Database command execution error. A SQL
    statement failed to execute. The actual error may have been written to a log file. at
    com.sap.mdm.data.commands.ModifyRecordCommand.execute(ModifyRecordCommand.java:163) at
    Regards,
    Subramanian V.
    Edited by: Subramanian Venkateswaran on Dec 10, 2008 8:11 PM

    Hi Subramanian  ,
    The error looks more like a problem with the data base or MDM system rather than the java code.
    Which is the underlying database you are using with MDM? As some users have faced some difficulties when working with the DB2 Data base,If this is the data base you too are working upon then may be the issue could be similar,if possible try using the Oracle or SQL data base as these databse show more compatibility than a DB2 when working with MDM .
    Also check the MDM users autorization and authentication to modifyor create recordrs in MDM.try given the user the ADMIN rights,and tehn try and see if teh user is able to modify/Create the mdm records.
    Lastly you can check the database instance and listener configuration correctly.try restarting the Database service form the system if possible.
    Hope It Helped
    Thanks & Regards
    Simona Pinto

  • Error while executing SSIS package - Error: 4014, Severity:20, State: 11. A fatal error occurred while reading the input stream from the network. The session will be terminated (input error: 109, output error: 0)

    Hi,
    We are getting the following error when running our SSIS packages on Microsoft SQL Server 2012 R2 on Windows Server 2008 R2 SP1:
    Error: 4014, Severity:20, State: 11.   A fatal error occurred while reading the input stream from the network. The session will be terminated (input error: 109, output error: 0)
    SQL Server Data Tools and SQL Server Database Engine reside on the same server.
    We tried the following:
    Disabling TCP Chimney Offload
    Installed Windows Server 2008 SP1
    Splitting our SSIS code into multiple steps so it is not all one large continuous operation
    The error occurs during a BulkDataLoad task.
    Other options we are investigating with the engineering team (out-sourced, so delayed responses):
    Firewall configurations (everything is local, so this should not make a difference)
    Disabling the anti-virus scanner
    Are there other things we can try?
    Any insight is greatly appreciated.
    Thanks!

    Hi HenryKwan,
    Based on the current information, the issue can be caused by many reasons. Please refer to the following tips:
    Install the latest hotfix based on your SQL Server version. Ps: there is no SQL Server 2012 R2 version.
    Change the MaxConcurrentExecutables property from -1 to another one based on the MAXDOP. For example, 8.
    Set "RetainSameConnection" Property to FALSE on the all the connection managers.
    Reference:
    https://connect.microsoft.com/SQLServer/feedback/details/774370/ssis-packages-abort-with-unexpected-termination-message
    If the issue is still existed, as Jakub suggested, please provide us more information about this issue.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Callable Statement throws exception..pls help

    When I use Callable Statement calling my function which returns Y if person is employee or nothing if not I get this error..
    Procedure not createdORA-06550: line 1, column 22:
    PLS-00103: Encountered the symbol "CHCK_EMP_STATUS" when expecting one of
    the following:
    . ( * @ % & = - + ; < / > at in mod not rem
    <an exponent (**)> <> or != or ~= >= <= <> and or like
    between is null is not || is dangling
    The symbol "." was substituted for "CHCK_EMP_STATUS" to continue.
    Here is my code..
    import java.sql.*;
    import java.io.*;
    public class FunctionTest
         public static void main(String args[])
              Connection conn = null;
              CallableStatement stmt = null;
              ResultSet rs=null;
         try
         Class.forName("oracle.jdbc.driver.OracleDriver");
         conn = DriverManager.getConnection("........");
         stmt = conn.prepareCall("{call function chck_emp_status(?,?)}");
              stmt.setString(1,"137897");
              stmt.registerOutParameter(2,Types.VARCHAR);
              stmt.execute();
              String s = stmt.getString(1);
              stmt.close();
              conn.commit();
              conn.close();
              }//try
              catch(Exception e)
         System.out.println("Procedure not created"+e.getMessage());
              finally
         }//main
    Please help...

    This is the function
    CREATE OR REPLACE function chck_emp_status (id number) return varchar2
    as
    emp_id          number;
    results          varchar(2);
    cursor emp_status is
         select id
         from emp
         where emp_status = 'A'
    and emp_id = id;
    begin
         open emp_status;
         fetch emp_status into emp_id;
         if emp_id%notfound THEN
              results := '';
         else
              results := 'Y';
         end if;
         close emp_id;
         return results;
    end;

  • Callable Statement Exception

    Hi,
    I am very new to Java SQL Callable Statement.
    The following is the program that i wrote to execute a Stored Procedure stored in MS SQL Server 2000.
    In my program I am actually retrieving back the value that I've passed to the MS SQL Server.
    ========================================
    import java.sql.*;
    import java.sql.Types;
    public class CallableTester
         private Connection connection;
         public CallableTester(Connection conn)
              connection = conn;
         public void executeInsert ()
         CallableStatement stmt = null;
         String sqlstmt;
         int rows;
         try {
              sqlstmt = "{ ? = call product(?, ?, ?, ?) }";
              stmt = connection.prepareCall(sqlstmt);
              stmt.setString(1, "61");
              stmt.setString(2, "62");
              stmt.setString(3, "63");
              stmt.setString(4, "67");
              stmt.registerOutParameter(1, Types.VARCHAR);
              stmt.executeUpdate();
              connection.commit();
              System.out.println("The value inserted are " + stmt.getString(1));
              stmt.close();
              System.out.println(sqlstmt);
         catch (Exception e){
              e.printStackTrace();
    =========================================
    The is no syntax error.
    When I run the program, I've got the following exception
    java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]COUNT field incorrect
    or syntax error
    at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6106)
    at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6263)
    at sun.jdbc.odbc.JdbcOdbc.SQLExecute(JdbcOdbc.java:2567)
    at sun.jdbc.odbc.JdbcOdbcPreparedStatement.execute(JdbcOdbcPreparedState
    ment.java:217)
    at sun.jdbc.odbc.JdbcOdbcPreparedStatement.executeUpdate(JdbcOdbcPrepare
    dStatement.java:139)
    at CallableTester.executeInsert(CallableTester.java:38)
    at DatabaseConnection.makeConnection(DatabaseConnection.java:22)
    at Start.main(Start.java:16)
    =========================================
    My database has a table named Product with the following fields and properties.
    Field id of type varchar
    Field name of type varchar
    Field costPrice of type decimal
    Field sellPrice of type decimal.
    =========================================
    The stored procedure for this table is
    CREATE PROCEDURE product @id varchar(8) = 8, @name varchar(50) = "productName", @costprice decimal = 88, @sellprice decimal =168 AS
    INSERT INTO PRODUCT VALUES(@id, @name, @costprice, @sellprice, @desc)
    GO
    =========================================
    Can anyone please to help me? I have been trying to solve this problem few days but I really can't.
    Your help will be appreciated.
    Thank you very much.

    I've reproduced your code with some modifications to make it work, I've tested it against a Sybase DB which is close enough to MS SQL Server.
    First the procedure. Note that I create and write to a temp table you can ignore this.
    create proc dmjtest
      @id varchar(8) = '8',
      @name varchar(50) = 'Dave Jenkins',
      @costPrice decimal = 1.23,
      @sellPrice decimal = 4.56
    as
    begin
      declare @rc int
      select @rc = 0
      create table #t (
        id varchar(8),
        name varchar(50),
        costPrice decimal,
        sellPrice decimal
      insert #t values (@id, @name, @costPrice, @sellPrice)
      if @@error = 0 select @rc = 1
      drop table #t
      return @rc
    endNow for the java code
    import java.sql.*;
    import java.sql.Types;
    public class CallableTester
      private Connection connection;
      public CallableTester(Connection conn) {
        connection = conn;
      public void executeInsert () {
        CallableStatement stmt = null;
        String sqlstmt;
        int rows;
        try {
          stmt = connection.prepareCall("{ ? = call dmjtest(?, ?, ?, ?) }");
          stmt.registerOutParameter(1, Types.INTEGER);
          stmt.setString(2, "1");
          stmt.setString(3, "product 1");
          stmt.setDouble(4, 63.0);
          stmt.setDouble(5, 67.0);
          stmt.executeUpdate();
          connection.commit();
          System.out.println("The return value is " + stmt.getInt(1));
          stmt.close();
        catch (Exception e){
          e.printStackTrace();
    }

  • Callable statement doubt-urgent

    hi all,i got a problem in callable statements.i know how to pass parameters to a procedure using a callable statement.but this time i need to pass a table name as a parameter.the problem is if i get that variable as a IN parameter in the procedure then how do you put that parameter in place of table name inside the procedure.heres a example,the pocedure is in oracle
    i am passing variable a from java
    create or replace procedure (a in varchar2)
    begin
    select * from <the parameter passed through a> where <condition>
    end;
    how can this be done.the select statement is given only as a example.the errors in the select are not emphasized here.the focus is on the table name.if there is any other way to do this do let me know.please reply fast.this is urgent.any kind of help is welcome.bye thiyagu.

    In some databases the SQL used in your stored procedure can reference 'variables' that contain the values to be used at statement execution time. This will be covered in your database's SQL reference. If this is not supported by your database you will have to perform a 'switch' based on the table name passed and select the SQL statement to be executed.

  • Memory leak in Callable Statement

    We are using Weblogic 6.1 and Oracle 8.1.7 for an application we are developing.
    Usage of callable statement seems to be resulting an a memory leak. The program runs
    in a loop and after processing 200 records, java.lang.outofMemory Exception is thrown
    We are unable to figure out a reason for the same.
    The code snippet is as below
    try
    //dbConn = ImportPODBConnect.getDBConnection(dsJNDIName, dsURL); //connect
    to DB <br>
    dbConn = DBConnect.getDBConnection(dsJNDIName, dsURL);
    //query = POQueries.selectPO(poId); //get the required
    query statement from the POQueries utility class
                             Print.log(" in getPO() ----> ********* before 1st stmt " + System.currentTimeMillis());
                        cstmt = dbConn.prepareCall("{ ? = call PO_HEADER_PROC(?)}");
                        cstmt.registerOutParameter(1, OracleTypes.CURSOR);
                   cstmt.setFloat(2, poId);
                   // execute and retrieve the result set
                   cstmt.execute();
                   getPORs = (ResultSet)cstmt.getObject(1);
                             Print.log(" in getPO() ----> ********* after 1st stmt " + System.currentTimeMillis());
                             if (!getPORs.next()) //if nothing returned then
    throw an exception
                                  Print.log("Unable to get the required PO:" + poId);
                                  throw new Exception("Unable to get the required PO:" + poId);
                             else //set all the variables
    of the PO header objects from the result set
                                  pohSl = new POHeaderSl();
                                  pohSl.setOvUserName(getPORs.getString("OVA_USER_NAME"));
                                  pohSl.setOvCompanyName(getPORs.getString("OVA_COMPANY_NAME"));
                                  pohSl.setAgent(getPORs.getString("AGENT"));
                                  pohSl.setApprovalCode(getPORs.getString("APPROVAL_CODE"));
                                  pohSl.setBrand(getPORs.getString("BRAND"));
                                  pohSl.setBusinessSegment(getPORs.getString("BUSINESS_SEGMENT"));
                                  pohSl.setBusinessSubSegment(getPORs.getString("BUSINESS_SUB_SEGMENT"));
                                  pohSl.setBuyDate(getPORs.getString("BUY_DATE"));
                                  pohSl.setCareContentLabel(getPORs.getString("CARE_CONTENT_LABEL"));
                                  pohSl.setCartonMarkings1(getPORs.getString("CARTON_MARKINGS_1"));
                                  pohSl.setCartonMarkings2(getPORs.getString("CARTON_MARKINGS_2"));
                                  pohSl.setCartonMarkings3(getPORs.getString("CARTON_MARKINGS_3"));
                                  pohSl.setCartonMarkings4(getPORs.getString("CARTON_MARKINGS_4"));
                                  pohSl.setComments(getPORs.getString("COMMENTS"));
                                  pohSl.setCommissionPerUnit(getPORs.getString("COMMISSION_PER_UNIT"));
                                  pohSl.setCompanyId(getPORs.getString("COMPANY_ID"));
                                  pohSl.setCompulsoryString(getPORs.getString("COMPULSORY_STRING"));
                                  pohSl.setConTimestamp(getPORs.getString("CON_TIMESTAMP"));
                                  pohSl.setCurrency(getPORs.getString("CURRENCY"));
                                  pohSl.setCustomerBillToNumber(getPORs.getString("CUSTOMER_BILL_TO_NUMBER"));
                                  pohSl.setCustomerLcBank(getPORs.getString("CUSTOMER_LC_BANK"));;
                                  pohSl.setCustomerLcDate(getPORs.getString("CUSTOMER_LC_DATE"));
                                  pohSl.setCustomerLcExpiryDate(getPORs.getString("CUSTOMER_LC_EXPIRY_DATE"));
                                  pohSl.setCustomerLcNumber(getPORs.getString("CUSTOMER_LC_NUMBER"));
                                  pohSl.setCustomerPoNumber(getPORs.getString("CUSTOMER_PO_NUMBER"));
                                  pohSl.setCustomerSaleDept(getPORs.getString("CUSTOMER_SALE_DEPT"));
                                  pohSl.setCustomerShipToNumber(getPORs.getString("CUSTOMER_SHIP_TO_NUMBER"));
                                  pohSl.setCustomerSo(getPORs.getString("CUSTOMER_SO"));
                                  pohSl.setDateLastModifiedErp(getPORs.getString("DATE_LAST_MODIFIED_ERP"));
                                  pohSl.setDateLastModifiedOv(getPORs.getString("DATE_LAST_MODIFIED_OV"));
                                  pohSl.setDateOfActivation(getPORs.getString("DATE_OF_ACTIVATION"));
                                  Print.log(" ******** inside getPO() ----- > ****** built Header" + System.currentTimeMillis()
                                  if(getPORs != null)
                                       getPORs.close();
                                       getPORs = null;
                                  if(cstmt != null)
                                       Print.log("In the close");
                                       cstmt.close();
                                       cstmt = null;
                        catch (Exception e)
                             System.out.println(" in dataAccess.getPO() ----- > " + e.toString());
                             throw new Exception(e.toString()); //if there are any exceptions
    then throw back the exceptions
                        finally //finally block to release any connections
    and statement objects
                             if(getPORs != null)
                                  getPORs.close();
                                  getPORs = null;
                             if (pstmt!=null)
                                  pstmt.close();
                                  pstmt = null;
                             if (cstmt!=null)
                                  cstmt.close();
                                  cstmt = null;
                             if (dbConn!=null)
                                  dbConn.close();
                                  dbConn = null;
                        return poSl; //return the PO object
    Can anyone help with this?

    hi
    This may happen when you open resultset objects and not close them properly.
    Try to ensure that, you should close the objects in individual try catch
    blocks so that one failure will not cause other close's to be skipped.
    You can try one more thing, I don't see you are using any LONG/ LONG
    RAW/BLOB/CLOB columns from your code here. If the table which you are trying
    to retrieve data from has this type of data you will benefit from using some
    tuning parameters here and may be able to avoid out of memory exceptions,
    take a look at the url,
    http://e-docs.bea.com/wls/docs61/oracle/advanced.html#1158561
    especially, try using,
    weblobic.oci.selectBlobChunkSize and set it to something low. you can set
    these properties on the connection pool.
    sree
    "Murali" <[email protected]> wrote in message
    news:[email protected]...
    >
    >
    We are using Weblogic 6.1 and Oracle 8.1.7 for an application we aredeveloping.
    Usage of callable statement seems to be resulting an a memory leak. Theprogram runs
    in a loop and after processing 200 records, java.lang.outofMemoryException is thrown
    >
    We are unable to figure out a reason for the same.
    The code snippet is as below
    try
    //dbConn = ImportPODBConnect.getDBConnection(dsJNDIName, dsURL);//connect
    to DB <br>
    dbConn = DBConnect.getDBConnection(dsJNDIName, dsURL);
    //query = POQueries.selectPO(poId); //getthe required
    query statement from the POQueries utility class
    Print.log(" in getPO() ----> ********* before 1st stmt " +System.currentTimeMillis());
    >
    cstmt = dbConn.prepareCall("{ ? = call PO_HEADER_PROC(?)}");
    cstmt.registerOutParameter(1, OracleTypes.CURSOR);
    cstmt.setFloat(2, poId);
    // execute and retrieve the result set
    cstmt.execute();
    getPORs = (ResultSet)cstmt.getObject(1);
    Print.log(" in getPO() ----> ********* after 1st stmt " +System.currentTimeMillis());
    >
    if (!getPORs.next()) //if nothing returnedthen
    throw an exception
    Print.log("Unable to get the required PO:" + poId);
    throw new Exception("Unable to get the required PO:" + poId);
    else //set all thevariables
    of the PO header objects from the result set
    pohSl = new POHeaderSl();
    pohSl.setOvUserName(getPORs.getString("OVA_USER_NAME"));
    pohSl.setOvCompanyName(getPORs.getString("OVA_COMPANY_NAME"));
    pohSl.setAgent(getPORs.getString("AGENT"));
    pohSl.setApprovalCode(getPORs.getString("APPROVAL_CODE"));
    pohSl.setBrand(getPORs.getString("BRAND"));
    pohSl.setBusinessSegment(getPORs.getString("BUSINESS_SEGMENT"));
    pohSl.setBusinessSubSegment(getPORs.getString("BUSINESS_SUB_SEGMENT"));
    pohSl.setBuyDate(getPORs.getString("BUY_DATE"));
    pohSl.setCareContentLabel(getPORs.getString("CARE_CONTENT_LABEL"));
    pohSl.setCartonMarkings1(getPORs.getString("CARTON_MARKINGS_1"));
    pohSl.setCartonMarkings2(getPORs.getString("CARTON_MARKINGS_2"));
    pohSl.setCartonMarkings3(getPORs.getString("CARTON_MARKINGS_3"));
    pohSl.setCartonMarkings4(getPORs.getString("CARTON_MARKINGS_4"));
    pohSl.setComments(getPORs.getString("COMMENTS"));
    pohSl.setCommissionPerUnit(getPORs.getString("COMMISSION_PER_UNIT"));
    pohSl.setCompanyId(getPORs.getString("COMPANY_ID"));
    pohSl.setCompulsoryString(getPORs.getString("COMPULSORY_STRING"));
    pohSl.setConTimestamp(getPORs.getString("CON_TIMESTAMP"));
    pohSl.setCurrency(getPORs.getString("CURRENCY"));
    pohSl.setCustomerBillToNumber(getPORs.getString("CUSTOMER_BILL_TO_NUMBER"));
    pohSl.setCustomerLcBank(getPORs.getString("CUSTOMER_LC_BANK"));;
    pohSl.setCustomerLcDate(getPORs.getString("CUSTOMER_LC_DATE"));
    pohSl.setCustomerLcExpiryDate(getPORs.getString("CUSTOMER_LC_EXPIRY_DATE"));
    pohSl.setCustomerLcNumber(getPORs.getString("CUSTOMER_LC_NUMBER"));
    pohSl.setCustomerPoNumber(getPORs.getString("CUSTOMER_PO_NUMBER"));
    pohSl.setCustomerSaleDept(getPORs.getString("CUSTOMER_SALE_DEPT"));
    pohSl.setCustomerShipToNumber(getPORs.getString("CUSTOMER_SHIP_TO_NUMBER"));
    pohSl.setCustomerSo(getPORs.getString("CUSTOMER_SO"));
    pohSl.setDateLastModifiedErp(getPORs.getString("DATE_LAST_MODIFIED_ERP"));
    pohSl.setDateLastModifiedOv(getPORs.getString("DATE_LAST_MODIFIED_OV"));
    pohSl.setDateOfActivation(getPORs.getString("DATE_OF_ACTIVATION"));
    Print.log(" ******** inside getPO() ----- > ****** built Header" +System.currentTimeMillis()
    if(getPORs != null)
    getPORs.close();
    getPORs = null;
    if(cstmt != null)
    Print.log("In the close");
    cstmt.close();
    cstmt = null;
    catch (Exception e)
    System.out.println(" in dataAccess.getPO() ----- > " + e.toString());
    throw new Exception(e.toString()); //if there are anyexceptions
    then throw back the exceptions
    finally //finally block to release anyconnections
    and statement objects
    if(getPORs != null)
    getPORs.close();
    getPORs = null;
    if (pstmt!=null)
    pstmt.close();
    pstmt = null;
    if (cstmt!=null)
    cstmt.close();
    cstmt = null;
    if (dbConn!=null)
    dbConn.close();
    dbConn = null;
    return poSl; //return the PO object
    Can anyone help with this?

  • Problems with Callable Statement

    Hi All,
    I have a problem with the callable statement that contains stored procedure.Here main thing i want to know is that can a stored procedure can be used for a database like Access.Because i am using Access as a database here.In which i have created the table Students.
    The table Students contains 3 fields they are name,amount & balance.
    The program is compiling well but during the runtime it is showing an error:-
    "Syntax error in Create Table" .
    For ur reference i have posted the code:-
    import java.io.*;
    import java.sql.*;
    public class CallStatDemo
    public static void main(String arg[])
    Connection con;
    CallableStatement cs;
    Driver dr;
    String str1,str2;
    int in1,in2;
    double d1;
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con=DriverManager.getConnection("jdbc:odbc:Ananth"); //the dsn name is Ananth
    init(con);
    if(con==null)
    System.out.println("Connection not Established");
    else
    cs=con.prepareCall("{call Payment(?,?)}");
    cs.setString(1,"Raman"); //name
    cs.setString(2,"2000"); //amount
    cs.execute();
    catch(Exception e)
    System.out.println("Error Message : "+e);
    static void init(Connection con)
    throws SQLException
    Statement stmt = con.createStatement();
    stmt.execute ("create or replace procedure Payment(name in text,amount in text)is " +
    " begin"+
    " update Students set balance=balance-amount where name =name;"+
    "end Payment;");
    stmt.close();
    Thanx,
    m.ananthu

    I have no clue if Access supports stored procedures, and this surely isn't related to JDBC at all. Did you check your Access documentation?
    Your posted code does not contain any CREATE TABLE statement, so where do you get your error (which line)
    Most probably Access does not support stored procedures. To verify that, you should execute your CREATE PROCEDURE statement from within Access, to verify that it is a supported statement.

  • Help with Callable Statements

    Hi,
    I am working on a problem which requires me to insert record into the database (mySQL) using Callable Statements.
    For this I have written 2 Stored Procedures (SP) which are as follows:
    CREATE DEFINER=`root`@`localhost` PROCEDURE `GeneratePcId`()
    BEGIN
    select max(pc_id)+1 from price;
    END $$
    CREATE DEFINER=`root`@`localhost` PROCEDURE `InsertPrice`(pc_id INT, pc_level INT, price INT, from_date DATE, to_date DATE)
    BEGIN
    INSERT INTO price VALUES (pc_id, pc_level, price, from_date, to_date);
    END $$
    The frist SP returns a number that adds 1 to the max of pc_id column which is the PK and max means the last row value.
    This value I want to use as a value for inserting the new row into the table. I have worked on this and the program chunk is here:
               // Create CallableStatement object 
                CallableStatement genid = conn.prepareCall("{? = call GeneratePcId()}");
                genid.registerOutParameter(1, Types.INTEGER);
                //ResultSet rs = (ResultSet)genid.executeQuery();
                //rs.next();
                genid.executeUpdate();
                int number = genid.getInt(1);
                CallableStatement cstmt = conn.prepareCall("{call InsertPrice (?, ?, ?, ?, ?)}");     
                // Bind values to the parameters           
                cstmt.setInt(1, number );           
                cstmt.setInt(2, 8);           
                cstmt.setInt(3, 600);           
                cstmt.setDate(4, Date.valueOf("2008-01-01"));           
                cstmt.setDate(5, Date.valueOf("2008-02-02"));       But when I run this program I get the following error:
    java.lang.NullPointerException at com.mysql.jdbc.CallableStatement$CallableStatementParamInfo.iterator(CallableStatement.java:324)
    at com.mysql.jdbc.CallableStatement.setInOutParamsOnServer(CallableStatement.java:1938)
    at com.mysql.jdbc.CallableStatement.execute(CallableStatement.java:749)
    at com.mysql.jdbc.CallableStatement.executeUpdate(CallableStatement.java:808)
    at CallableStatementExercise.query(CallableStatementExercise.java:36)
    at CallableStatementExercise.main(CallableStatementExercise.java:13)
    Line 13 points to genid.executeUpdate();
    Can anybody please advise me what the problem is?
    Shall be really grateful.
    Templar_Knight
    Message was edited by:
    templar_knight

    mervin,
    Find the following sample code regarding your issue,
    CallableStatement cstmt = (java.sql.Connection).prepareCall("{call getTestData(?)}");
                   cstmt.registerOutParameter(1, java.sql.Types.INTEGER);
                   cstmt.registerOutParameter(2, java.sql.Types.DECIMAL);
                   ResultSet rs = cstmt.executeQuery();
    //. . . retrieve result set values with rs.getter methods
                   java.lang.Integer x = cstmt.getInt(1);
                   java.math.BigDecimal n = cstmt.getBigDecimal(2);
    I think your issue is resolved.

  • Error on DS creation (ResourceException: Could not create pool connection)

    Hi,
    When trying to create a DS on a WLS 10.3 on Windows Vista to connect to an Oracle 10.2.0.4 RAC database, I am getting the exception below. I use the OCI driver. Everything's fine when I use the thin driver though.
    <Jan 31, 2009 9:56:56 AM AST> <Warning> <JDBC> <BEA-001129> <Received exception while creating connection for pool "EPDVDS":
    <Jan 31, 2009 9:56:57 AM AST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with I
    D '1233385014499' for task 'weblogic.deploy.configChangeTask.0'. Error is: 'weblogic.application.ModuleException: '
    weblogic.application.ModuleException:
    at weblogic.jdbc.module.JDBCModule.prepare(JDBCModule.java:289)
    at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
    at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
    at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58)
    Truncated. see log file for complete stacktrace
    weblogic.common.ResourceException: weblogic.common.ResourceException: Could not create pool connection. The DBMS driver excep
    tion was:
    at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(ConnectionEnvFactory.java:253)
    at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1109)
    at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1033)
    at weblogic.common.resourcepool.ResourcePoolImpl.start(ResourcePoolImpl.java:214)
    at weblogic.jdbc.common.internal.ConnectionPool.doStart(ConnectionPool.java:1051)
    Truncated. see log file for complete stacktrace
    <Jan 31, 2009 9:56:57 AM AST> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating activate task for ap
    plication 'EPDVDS'.>
    <Jan 31, 2009 9:56:57 AM AST> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
    weblogic.application.ModuleException:
    at weblogic.jdbc.module.JDBCModule.prepare(JDBCModule.java:289)
    at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
    at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
    at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58)
    Truncated. see log file for complete stacktrace
    weblogic.common.ResourceException: weblogic.common.ResourceException: Could not create pool connection. The DBMS driver excep
    tion was:
    at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(ConnectionEnvFactory.java:253)
    at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1109)
    at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1033)
    at weblogic.common.resourcepool.ResourcePoolImpl.start(ResourcePoolImpl.java:214)
    at weblogic.jdbc.common.internal.ConnectionPool.doStart(ConnectionPool.java:1051)
    Truncated. see log file for complete stacktrace
    <Jan 31, 2009 9:56:58 AM AST> <Error> <Console> <BEA-240003> <Console encountered the following error weblogic.application.Mo
    duleException:
    at weblogic.jdbc.module.JDBCModule.prepare(JDBCModule.java:289)
    at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
    at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
    at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58)
    at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:42)
    at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:615)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
    at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191)
    at weblogic.application.internal.SingleModuleDeployment.prepare(SingleModuleDeployment.java:16)
    at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:155)
    at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
    at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.jav
    a:197)
    at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:89)
    at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
    at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:723)
    at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1190)
    at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:216)
    at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentRece
    iverCallbackDeliverer.java:157)
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.prepare(DeploymentReceiverCallba
    ckDeliverer.java:40)
    at weblogic.deploy.service.internal.statemachines.targetserver.AwaitingContextUpdateCompletion.callDeploymentReceiver
    s(AwaitingContextUpdateCompletion.java:164)
    at weblogic.deploy.service.internal.statemachines.targetserver.AwaitingContextUpdateCompletion.handleContextUpdateSuc
    cess(AwaitingContextUpdateCompletion.java:66)
    at weblogic.deploy.service.internal.statemachines.targetserver.AwaitingContextUpdateCompletion.contextUpdated(Awaitin
    gContextUpdateCompletion.java:32)
    at weblogic.deploy.service.internal.targetserver.TargetDeploymentService.notifyContextUpdated(TargetDeploymentService
    .java:225)
    at weblogic.deploy.service.internal.DeploymentService$1.run(DeploymentService.java:189)
    at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: weblogic.common.ResourceException: weblogic.common.ResourceException: Could not create pool connection. The DBMS d
    river exception was:
    at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(ConnectionEnvFactory.java:253)
    at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1109)
    at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1033)
    at weblogic.common.resourcepool.ResourcePoolImpl.start(ResourcePoolImpl.java:214)
    at weblogic.jdbc.common.internal.ConnectionPool.doStart(ConnectionPool.java:1051)
    at weblogic.jdbc.common.internal.ConnectionPool.start(ConnectionPool.java:146)
    at weblogic.jdbc.common.internal.ConnectionPoolManager.createAndStartPool(ConnectionPoolManager.java:385)
    at weblogic.jdbc.common.internal.ConnectionPoolManager.createAndStartPool(ConnectionPoolManager.java:326)
    at weblogic.jdbc.module.JDBCModule.prepare(JDBCModule.java:251)

    Hi,
    I am also using OCI driver, as some of the functions for XMLType are not supported by thin driver.
    I am getting similar error, as mentioned in the thread as
    <BEA-001129> <Received exception while creating connection for pool "11g_Connection": >
    oracle.adf.share.config.ADFConfigFactory cleanUpApplicationState
    INFO: Cleaning up application state
    weblogic.application.ModuleException:
         at weblogic.jdbc.module.JDBCModule.prepare(JDBCModule.java:289)
         at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
         at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58)
         Truncated. see log file for complete stacktrace
    weblogic.common.ResourceException: weblogic.common.ResourceException: Could not create pool connection. The DBMS driver exception was:
         at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(ConnectionEnvFactory.java:253)
         at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1109)
         at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1033)
         at weblogic.common.resourcepool.ResourcePoolImpl.start(ResourcePoolImpl.java:214)
         at weblogic.jdbc.common.internal.ConnectionPool.doStart(ConnectionPool.java:1051)
         Truncated. see log file for complete stacktrace
    I have already tested with a standalone program and it works, but error is thrown with weblogic server.
    My connection string is jdbc:oracle:oci:@//localhost:1521/orcl11
    Any ideas on how this error can be avoided?
    Thanks
    Raji

Maybe you are looking for

  • Slow System with K7N420

    I have a system with a K7N420 in which I had 256MB(x2) of Crucial memory. I stole on stick for a new box I was building while I waited for prices to go down. When they did I moved the second stick back to the K7N420 box. When I moved it back I also d

  • How to automate the process of adding members into the planning workflow and assigning owners to it?

    Hi, We have a workflow XYZ. After every two-three days our entity structure is getting refreshed - so new entities comes in. Every time we have to manually add these new entities to the workflow and assign owners to it. Please let me know if there is

  • Workitem completed automatically based on condition

    Hi All, I have a question : If I set a completion condition for a work item task (standard) I am not getting the workitem in the Business Workplace. The condition is getting fulfilled and the Workitem is also getting status Completed. So, in this cas

  • Difference Between OPI and OCI

    Hi SRM Gurus, Can anybody explain the differences between OPI and OCI. Regards, Manik

  • What is exactly "ABAP SCS"?

    Could anybody explain what does "ABAP SCS" do? How to configure it? Thanks! Points!