AbstractMethodError with addBatch on CallableStatement

Hi!!
I am connecting to DB2 through Weblogic5.1 connection Pool and trying
to execute a batch update statement on both PreparedStatement and
CallableStatement, but it gives me the error AbstractMethodError.
Could anyone please suggest the cause of this error and appropriate
action against this error.
Thanks and Regards,
Anitha

Anitha,
Could you post full text of the exception here?
Regards,
Slava Imeshev
"Anitha Ramesh" <[email protected]> wrote in message
news:[email protected]..
Hi!!
I am connecting to DB2 through Weblogic5.1 connection Pool and trying
to execute a batch update statement on both PreparedStatement and
CallableStatement, but it gives me the error AbstractMethodError.
Could anyone please suggest the cause of this error and appropriate
action against this error.
Thanks and Regards,
Anitha

Similar Messages

  • Got AbstractMethodError with PreparedStatement.setCharacterStream

    Hi,
    I'm running WLS510SP12 NT with Oracle 5.0.6 and JDBC-Thin-Drivers, and
    i'm getting this exception when writing a character stream into a
    prepared sql-statement:
    java.rmi.RemoteException: Exception in non-transactional EJB invoke:
    java.lang.AbstractMethodError:
    weblogic/jdbc/pool/PreparedStatement.setCharacterStream
         at weblogic.jdbc20.rmi.internal.PreparedStatementImpl.setCharacterStream(PreparedStatementImpl.java:330)
         at weblogic.jdbc20.rmi.SerialPreparedStatement.setCharacterStream(SerialPreparedStatement.java:421)
         at com.mybean.add(BOFaxBean.java:970)
    Note that the Exception is not thrown in the oracle jdbc-driver, but
    in a weblogic class.
    Sourcecode:
    pstm = con.prepareStatement("INSERT INTO FAX VALUES(?,?,?,?,?,?,?)");
    pstm.setCharacterStream(3, new StringReader(sFAX.toString()),
    sFAX.length() );
    Can anybody help?
    Regards,
    Andy

    Andreas Lange wrote:
    Hi,
    I'm running WLS510SP12 NT with Oracle 5.0.6 and JDBC-Thin-Drivers, and
    i'm getting this exception when writing a character stream into a
    prepared sql-statement:
    java.rmi.RemoteException: Exception in non-transactional EJB invoke:
    java.lang.AbstractMethodError:
    weblogic/jdbc/pool/PreparedStatement.setCharacterStream
    at weblogic.jdbc20.rmi.internal.PreparedStatementImpl.setCharacterStream(PreparedStatementImpl.java:330)
    at weblogic.jdbc20.rmi.SerialPreparedStatement.setCharacterStream(SerialPreparedStatement.java:421)
    at com.mybean.add(BOFaxBean.java:970)
    Note that the Exception is not thrown in the oracle jdbc-driver, but
    in a weblogic class.That class is just catching all exceptions from the DBMS driver, and casting them to a SQLException.
    It's the Oracle driver you're using. It doesn't even know about that JDBC 2.0 call. It must be a
    JDBC 1.0 driver.
    Joe
    >
    >
    Sourcecode:
    pstm = con.prepareStatement("INSERT INTO FAX VALUES(?,?,?,?,?,?,?)");
    pstm.setCharacterStream(3, new StringReader(sFAX.toString()),
    sFAX.length() );
    Can anybody help?
    Regards,
    Andy

  • Issue with BatchExection of CallableStatement with StoredProcedures in DB2

    Hi,
    I have an issue with the batch execution (executeBatch() method) of the CallableStatement.
    I use IBM DB2 V8.1 database. When i m doing the batch update with the CallableStatement which is obtained on the Stored Procedure call, the adding is done successfully. But the Execution is not happening as expected. Its executing only one row (mostly the first row in the batch). The database is having only one row inserted as the procedure is for inserting a row at a time.
    Once it gets executed, i m able to get the batchcount correctly where it shows the total number of elements being processed while adding. But the execution does not take place.
    If the same CallableStatement is obtained on the simple sql query (say in my case the INSERT statement), its working perfectly. But not on the Procedure.
    I am using WSAD 5.1 with db2java.zip. Can anyone help me please? I had looked into the JDBC Driver Implementation as well the JDBC Support in the IBM site as well , but could not get the reqd info!
    I myself had worked previously the same executeBatch() with Stored Procedures in SQL Server 2000 with no issues.
    Any suggestions and immediate help is much appreciated!
    Thanks,
    Raghavan alias Saravanan M.

    Thanks guys - its just not something I've really noticed before, as most forms I do have enough width compared to this page where I have two side by side.
    Will pop that bit of CSS in.

  • Trying to get rows to ResultSet with CallableStatement and stored functio

    Hello!
    I'm using JDBC with Oracle XE 11g2, driver ojdbc6.jar (Oracle Database 11g Release 2 (11.2.0.3) JDBC Drivers, JDBC Thin for All Platforms) from oracle.com
    I've got a table
    CREATE TABLE ORGANIZATIONS
    CODE VARCHAR2(4),
    DESCRIPTION VARCHAR2(255)
    And I'm trying to get all organizations into ResultSet using CallableStatement with stored function:
    CallableStatement cs = connection.prepareCall("{? = call FN_GET_ROWS}");
    cs.registerOutParameter(1, oracle.jdbc.OracleTypes.CURSOR);
    cs.execute();
    I've created two types:
    CREATE OR REPLACE
    TYPE TEST_OBJ_TYPE AS OBJECT (
    CODE VARCHAR2(4),
    DESCRIPTION VARCHAR2(255)
    and
    CREATE OR REPLACE
    TYPE TEST_TABTYPE AS TABLE OF TEST_OBJ_TYPE
    and my function is
    CREATE OR REPLACE
    FUNCTION FN_GET_ROWS RETURN TEST_TABTYPE AS V_Test_Tabtype Test_TabType;
    BEGIN
    SELECT TEST_OBJ_TYPE(A.CODE, A.DESCRIPTION)
    BULK COLLECT INTO V_Test_TabType
    FROM
    (SELECT CODE, DESCRIPTION
    FROM ASM.ORGANIZATIONS
    ) A;
    RETURN V_Test_TabType;
    END;
    but when I run my program I've got error:
    P LS-00382: expression is of wrong type
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored

    It doesn't look like your PL/SQL Function is returning a REF CURSOR to me. It looks like you are returning a PL/SQL Index-By table of Objects.
    Regards,
    Mark

  • How to use CallableStatement  for StroredProcedure in java?

    I've successfully created storedProcedure for select comment in mysql.but how implement in java code with using of CallableStatement.Pls help me
    Message was edited by:
    SKVenkates

    try this in main:
    try {UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());}
    catch (Exception exc) {System.err.println("Eroare la incarcarea look & feel" + exc);}

  • JDBC - how to handle insert that returns value (bind?)

    Hi,
    I'm trying to do an insert into a table in an Oracle database with an auto-incrementing primary key (using a trigger and sequence) and I need to retrieve the value after the insert. From SQL*Plus, I'd enter:
    var id number;
    INSERT INTO mytable (name) VALUES ('foo') RETURNING id into :id;
    whereupon if I do "print id", I get the value of the id field from the newly-inserted record.
    The big question is how to achieve the same thing using JDBC. I've been flailing around all morning trying to figure it out and suspect it has something to do with using a CallableStatement instead of a PreparedStatement, but all of the examples I've seen so far only deal with calling stored procedures instead of raw SQL, and they all omit the part where some variable is bound to the resultset.
    Assuming I want to have the Java variable (int? Integer()?) "newId" set to the value being returned by the SQL statement as "id" (or ":id"?), what do I need to do between getting the connection and looking at "newId" to see what the value returned by the statement is?
    ie,
    Connection conn = db.connect();
    int newId;
    // show me what I need to do here
    System.out.println("The id of the newly-inserted record is:");
    System.out.println(newId);Thanks!

    This is untested:
    use the executeUpdate() method from the Statement. The return value will be your result from the RETURNING id portion of your SQL statement, if not then you'll probably have to do a seperate select or/and explicit return to get the value back from SQL.

  • How can I use the procedures and functions in my library

    hello, all
    I have a pl/sql library MYLIB.pld, MYLIB.pll and MYLIB.plx.
    How can I invoke procedures and functions there in JDeveloper?
    Thanks.
    Damon

    I am indeed using ADF BC to re-develop the oracle application.
    Here is my situation:
    We have an oracle form application.
    Our objective is to try to re-use the existing sources in the form application as much as possible:
    1. tons of procedures and functions in a pl/sql library(a file with extension name portfolioLib.pll or portfolioLib.plx);
    2. tons of form-level triggers, data-block triggers and item-triggers;
    3. tons of database stored procedures and triggers;
    After doing a research on JDeveloper, we decide to use ADF Swing+ADF BC to re-develop the application.
    My opinion for the above three kinds of sources in our form application is:
    for 1: we try to move most of procedures and functions into database(except Form build-in);
    for 2: we try to wrap those triggers in a SQLJ class;
    for 3: we try to call database procedures and functions with PreparedStatment or CallableStatement;
    I just do a test on a post-query trigger on a data-block:
    I created a sqlj file, named testSQLJ.sqlj in the test.view package;
    I tried to call it in createInstanceFromResultSet of testDeptVOImpl.java which is test.model package,
    I was told that testSQLJ cannot be found there. why?
    How can I call some classes from test.view package in some classes of test.model?
    I read some documents about how to deal with post-query trigger in JDeveloper: create a view with SQL statement, but it seems that it does not support pl/sql statement there.
    Can you give me some opinion about the above stuff?
    I really appreciate your help.
    Damon

  • ADF 11g : Calling PL Sql Function

    Hi there..
    I am trying to call a PL/SQL Function from my application module in ADF 11g.
    The code looks something like this
        public void getName(int relationNumber) {
            DBTransaction tc = getDBTransaction();
            StringBuffer statement = new StringBuffer("begin ");
            statement.append("? := COMP_RLE.RLE_GET_NAME(?);");
            statement.append("end;");
            OracleCallableStatement cs = (OracleCallableStatement)tc.createCallableStatement(statement.toString(), 0);
            try {
                cs.registerOutParameter(1, Types.VARCHAR);
                cs.setInt(2, relationNumber);
                cs.execute();
                String retValue = cs.getString(1);
                System.out.println(retValue);
            } catch (SQLException e) {
                System.err.println("Something went wrong: " + e.getMessage());
        }When I run this in TOAD I get a result back in the form of a String.
    However when I run the code above in a Unit Test I get back "null".
    Does anybody know what I am doing wrong here?
    Hope someone can help me out here.
    Thanks in advance,
    Gideon

    I think it will probably work that way.. but the thing is.. I have been going over examples.. and they work with the CallableStatement.
    I just want to know how come this isn't working the way it should.
    Did I miss something?
    Examples that I was looking at are:
    <li>http://www.experts-exchange.com/Programming/Languages/Java/Q_24106340.html
    <li>http://www.oracle.com/technology/sample_code/tech/java/codesnippet/jdbc/varray/index.html
    <li>Re: Returning a value from PL/SQL Function in ADF BC
    and
    <li>http://download.oracle.com/docs/cd/E15523_01/web.1111/b31974/bcadvgen.htm#sm0457
    They all work with the (Oracle)CallableStatement
    Edited by: Gideon Liem on Dec 4, 2009 12:27 AM

  • Regarding execution of pl/sql procedure using JSP

    HI all
    Please help me.
    i am customizing a jsp page ,which is executing one sql procedure first then selecting data from the table in which procedure is inserting.
    How can i pass parameter dynamically to the sql procedure ? ,which i am getting from an HTML page.
    Please help me out.
    regards
    satendra

    this is the sample code provided by oracle.
    * This sample shows how to call PL/SQL blocks from JDBC.
    import java.sql.*;
    class PLSQL
    public static void main (String args [])
    throws SQLException, ClassNotFoundException
    // Load the Oracle JDBC driver
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    String url = "jdbc:oracle:oci8:@";
    try {
    String url1 = System.getProperty("JDBC_URL");
    if (url1 != null)
    url = url1;
    } catch (Exception e) {
    // If there is any security exception, ignore it
    // and use the default
    // Connect to the database
    Connection conn =
    DriverManager.getConnection (url, "scott", "tiger");
    // Create the stored procedures
    init (conn);
    // Cleanup the plsqltest database
    Statement stmt = conn.createStatement ();
    stmt.execute ("delete from plsqltest");
    // Close the statement
    stmt.close();
    // Call a procedure with no parameters
    CallableStatement procnone = conn.prepareCall ("begin procnone; end;");
    procnone.execute ();
    dumpTestTable (conn);
    procnone.close();
    // Call a procedure with an IN parameter
    CallableStatement procin = conn.prepareCall ("begin procin (?); end;");
    procin.setString (1, "testing");
    procin.execute ();
    dumpTestTable (conn);
    procin.close();
    // Call a procedure with an OUT parameter
    CallableStatement procout = conn.prepareCall ("begin procout (?); end;");
    procout.registerOutParameter (1, Types.CHAR);
    procout.execute ();
    System.out.println ("Out argument is: " + procout.getString (1));
    procout.close();
    // Call a procedure with an IN/OUT prameter
    CallableStatement procinout = conn.prepareCall ("begin procinout (?); end;");
    procinout.registerOutParameter (1, Types.VARCHAR);
    procinout.setString (1, "testing");
    procinout.execute ();
    dumpTestTable (conn);
    System.out.println ("Out argument is: " + procinout.getString (1));
    procinout.close();
    // Call a function with no parameters
    CallableStatement funcnone = conn.prepareCall ("begin ? := funcnone; end;");
    funcnone.registerOutParameter (1, Types.CHAR);
    funcnone.execute ();
    System.out.println ("Return value is: " + funcnone.getString (1));
    funcnone.close();
    // Call a function with an IN parameter
    CallableStatement funcin = conn.prepareCall ("begin ? := funcin (?); end;");
    funcin.registerOutParameter (1, Types.CHAR);
    funcin.setString (2, "testing");
    funcin.execute ();
    System.out.println ("Return value is: " + funcin.getString (1));
    funcin.close();
    // Call a function with an OUT parameter
    CallableStatement funcout = conn.prepareCall ("begin ? := funcout (?); end;");
    funcout.registerOutParameter (1, Types.CHAR);
    funcout.registerOutParameter (2, Types.CHAR);
    funcout.execute ();
    System.out.println ("Return value is: " + funcout.getString (1));
    System.out.println ("Out argument is: " + funcout.getString (2));
    funcout.close();
    // Close the connection
    conn.close();
    // Utility function to dump the contents of the PLSQLTEST table and
    // clear it
    static void dumpTestTable (Connection conn)
    throws SQLException
    Statement stmt = conn.createStatement ();
    ResultSet rset = stmt.executeQuery ("select * from plsqltest");
    while (rset.next ())
    System.out.println (rset.getString (1));
    stmt.execute ("delete from plsqltest");
    rset.close();
    stmt.close();
    // Utility function to create the stored procedures
    static void init (Connection conn)
    throws SQLException
    Statement stmt = conn.createStatement ();
    try { stmt.execute ("drop table plsqltest"); } catch (SQLException e) { }
    stmt.execute ("create table plsqltest (x char(20))");
    stmt.execute ("create or replace procedure procnone is begin insert into plsqltest values ('testing'); end;");
    stmt.execute ("create or replace procedure procin (y char) is begin insert into plsqltest values (y); end;");
    stmt.execute ("create or replace procedure procout (y out char) is begin y := 'tested'; end;");
    stmt.execute ("create or replace procedure procinout (y in out varchar) is begin insert into plsqltest values (y); y := 'tested'; end;");
    stmt.execute ("create or replace function funcnone return char is begin return 'tested'; end;");
    stmt.execute ("create or replace function funcin (y char) return char is begin return y || y; end;");
    stmt.execute ("create or replace function funcout (y out char) return char is begin y := 'tested'; return 'returned'; end;");
    stmt.close();
    }

  • Oracle.jbo.SQLStmtException & java.sql.SQLException: Invalid column index

    Hi,
    I am using Jdeveloper 10.1.2.3 and created a ADFBC JSP struts application. I have an entity based viewobject which we have modified, enhance over the years. Some where along this way a bug was introduced in the viewobject that has the following exception
    JBO-30003: The application pool (pkgEmpContExp.amEmpContExpSnLocal) failed to checkout an application module due to the following exception:
    oracle.jbo.JboException: JBO-29000: Unexpected exception caught: oracle.jbo.SQLStmtException, msg=JBO-27122: SQL error during statement preparation. Statement: SELECT statement here
    ## Detail 0 ##oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation
    ## Detail 0 ##java.sql.SQLException: Invalid column index
    The viewobject query on its own has no indexes. It does have a lot of transient attributes which are populated with Preparestatements and callablestatements.
    If you want I can give the whole stacktrace.
    This always occurs after we insert into this table and we click on another link. If we clear the browser cache, it works properly.
    Can anyone please guide me in resolving this issue.
    Thanks in advance

    Hi,
    any chance the database table has been changed with the change not being reflected in the ADF BC model?
    Frank

  • Pre mature termination of Java Program (Servlet)

    Hi,
    Any One can help me for the above subject
    i have my application on java servlets/JDBC on linux (red hat 6.2)
    with Oracle 8i 8.1.6 we we fire a application which invloves some big table (10) and millions of row after 30 to 35 minutes my java application dies pre maturly.
    i have 250 MB SGA and java settings in init.ora are as
    java_pool_size = 50M #20971520
    java_max_sessionspace_size = 90000000
    java_soft_sessionspace_limit = 90000000

    You use the java in the DB?
    We makes DB connection thru java class.
    What kind of Class do you use for Insert?
    Class.forName("oracle.jdbc.driver.OracleDriver")
    Do you use PreparedStatemend with addBatch over all Rows or do you set commit after every rows?
    Yes we are using PreparedStatemend and committing after each row.
    Do you get an exception?
    No we do not get any exception.

  • How to call  procedure in jdeveloper ?

    hi ,
    I wrote a procedure in database , but I don't know how to call it in jdeveloper 11g . Can somebody give some advice or material ? thanks !!

    Calling a stored procedure in Java has more then one way. The way Timo showed is the ADF BC way. The more common way from a Java program is to use JDBC with DataSource and CallableStatements. The Oracle RDBMS JDBC guide shows a short intro to JDBC and the Oracle JDBC driver specifics. http://download.oracle.com/docs/cd/E11882_01/java.112/e10589/toc.htm
    Another way is to use the Database Navigator and run/debug the stored procedure.
    --olaf                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • SQL Exception: General Error - Help Needed

    Hi,
    I am getting an error at QuerySales.executeUpdate() statement in the following code.
    I never had this kind of problem with other examples using executeUpdate statement. I even checked with "addBatch" but got the same error. Please help me if you know anything.
    Thanks,
    Ravi
    PreparedStatement QuerySales;
    insertString= "insert into TestNoName values (?, ?)";
    String query2 = "SELECT Number, Name FROM TestNoName";
    Statement stmt;
    try {
    con = DriverManager.getConnection(url,"","");
    System.out.println("Successfully Connected to Database");
    stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
    QuerySales = con.prepareStatement(insertString, ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
    ResultSet rs2 = stmt.executeQuery(query2);
    for (int i=0; i<=10; i++)
    rs2.last();
    int count = rs2.getRow();
    System.out.println(count);
    if (count == 0)
    lNumber = 1;
    else {
    lNumber = rs2.getInt("Number");
    lNumber++;
    QuerySales.setInt(1,lNumber);
    QuerySales.setString(2,"Ravi");
    QuerySales.executeUpdate();
    System.out.println("Hi");
    System.out.println("Exececuted SQL Statement- Inserted One Record");
    System.out.println("Fields of TestNoName");
    int count1=0;
    ResultSet rs3 = stmt.executeQuery(query2);
    //rs2.beforeFirst();
    while (rs3.next()) {
    count1++;
    int n = rs3.getInt("Number");
    String Name1 = rs3.getString("Name");
    System.out.println(n + " " + Name1);
    System.out.println(count1);
    stmt.close();
    con.close();
    } catch(SQLException ex) {
    System.err.println("SQLException: " + ex.getMessage());
    }

    I found the reason for error. I declared the result set object within the for loop. Now it is working fine.
    Ravi

  • Progress Bar of a Database Transaction

    Hi,
    Is it possible to have a progress bar showing the progress a Database Transaction?
    I use MS Access and a PreparedStatement which I fill up with addBatch() and then I execute with executeBatch().
    Inserting in an Access Table 10.000 new entries takes about a minute...
    Instead of having the user wait with a message "Please wait..."
    can I track its progress somehow?
    Thanks!!!

    Unfortunately, I don't think that there's a standard way to get asynchronous responses back from the database on the status of your batches. You could fake it by figuring out the "standard" time it takes, but otherwise you're in the dark about your statement's status.

  • How to use preparedStatement

    i want to use a prepare statement to return a recordset...
    but i got the following error:
    C:\Downloads\java\jasonHunter jservlet2\jservlet2-examples\ch09\DBPhoneLookup5.java:31: incompatible types
    found : int
    required: java.sql.ResultSet
    rs=pstmt.executeUpdate();
    ^
    1 error
    Exit code: 1
    There were errors
    the coding are:
    pstmt = con.prepareStatement("SELECT * FROM service where sID=?" , ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
    pstmt.setInt(1, Integer.parseInt(ser ));
    rs=pstmt.executeUpdate();
    rs is RecordSet...
    anyone can help??

    try executeQuery() or executeQuery(String) with the string
    of query and don't use prepareStatement, or you can also add batches with addBatch() and then make executeBatch()..
    pick one:)

Maybe you are looking for

  • Is there a way of combining From and To columns in Mail?

    I've just tumbled to the fact that Mail displays separate From and To columns--rather than an integrated Who or Correspondent one. In Thunderbird, with the add on Show InOut, or in the venerable Eudora, by default, there is a single column that shows

  • Counter output 2V when using gate and source at the same time..

    I'm using NI TIO-6601. I connected output of counter_0 to pfi 34 and pfi27 on hardware(CB-68LP). pfi 34 is used for gate to counter_1 and counter_2. With this gate, counter_1 and counter_2 generate pulse trains when the gate is in high state. pfi 27

  • I have no sound after updating to iOS 6.1.3

    After updating I lost sound. Tried restoring and still no sound. Guess I'll have to get a new phone...any other suggestions?

  • Premiere Elements shows white screen

    At some point in generating a project, the SW suddenly shows a "white screen". Then the Windows 7 Screen gives you the option to wait for the program or exit. After 30 to 50sec. the screen is normal again, but then starts showing white again. When st

  • Regarding  dimension creation

    Hi, When I am creating a dimension it gives the default attributes like ID-- surrogate Identifier Name-- Business Identifier Description Business Identifier I have to create a dimension. My dimension does not have these attributes.(ID,Name,Descriptio


HashFlare