BatchUpdateException

hello, there:
I was running an jdbc-related app, and I used preparedStatement.addBatch in this app to insert data into database.
it was fine but today I got an exception: java.sql.BatchUpdateException: Overflow Exception trying to bind NaN
Anyone knows what causes this kind of Exception and how I can solve this problem?
Thanks a lot,
Sway

It looks like you did some bad arithmetic, resulting in a "Not A Number" (NaN) result. For example:
public class Nan {
   public static void main(String[] args) {
      float nan = 0f / 0f;
      System.out.println(nan);
}When you then try to store that value in a floating point column, the database complains. So the problem is in your Java logic, and the database is trying to prevent you from corrupting the column!
It's not specific to the BatchUpdate, it just happened to occur in one, and so the BatchUpdate had to report the error.
Dave.

Similar Messages

  • Java.sql.BatchUpdateException: ORA-12899[ value too large for column.......

    Hi All,
    I am using SOA 11g(11.1.1.3). I am trying to insert data in to a table coming from a file. I have encountered the fallowing error.
    Exception occured when binding was invoked.
    Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'insert' failed due to: DBWriteInteractionSpec Execute Failed Exception.
    *insert failed. Descriptor name: [UploadStgTbl.XXXXStgTbl].*
    Caused by java.sql.BatchUpdateException: ORA-12899: value too large for column "XXXX"."XXXX_STG_TBL"."XXXXXX_XXXXX_TYPE" (actual: 20, maximum: 15)
    *The invoked JCA adapter raised a resource exception.*
    *Please examine the above error message carefully to determine a resolution.*
    The data type of the column errored out is VARCHAR2(25). I found related issue in metalink, java.sql.BatchUpdateException (ORA-12899) Reported When DB Adapter Reads a Row From a Table it is Polling For Added Rows [ID 1113215.1].
    But the solution seems not applicable in my case...
    Can anyone encountered same issue?? Is this a bug? If it is a bug, do we have patch for this bug??
    Please help me out...
    Thank you all...
    Edited by: 806364 on Dec 18, 2010 12:01 PM

    It didn't work.
    After I changed length of that column of the source datastore (from 15 to 16), ODI created temporary tables (C$ with I$) with larger columns (16 instead of 15) but I got the same error message.
    I'm wondering why I have to extend length of source datastore in the source model if there are no values in the source table with a length greather than 15....
    Any other idea? Thanks !

  • I am stcuk in error exception  java.sql.BatchUpdateException

    Dear,
    I have write a program which reads data from a file and write in a database Postrgresql.But when i run my program it shows the error after some time running.It shows the exception which is
    "java.sql.BatchUpdateException: Batch entry 122,098 INSERT INTO GEONAME VALUES (3294551)"
    "at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2516)"
    These are the exceptions can anyone please help me to remove this.
    Thanks

    That might be telling you about a specific error in the sequence of batch commands that you are processing.
    Try retrieving the getUpdateCounts() from that exception and print the results.

  • PreparedStatement.executeBatch() and BatchUpdateException

    Hi,
    I am using PreparedStatement's executeBatch() method to make batch operations,
    for such a scenario is there a way to continue the operation 3 and 4 when the operation 2 fails?
    operation 1 (will succeed alone)
    operation 2 (will fail alone)
    operation 3 (will succeed alone)
    operation 4 (will succeed alone)

    Hi, I've already looked the link you've sent.
    Let me give more detail about the result of my scenario.
    The first two successfull insert operations really updates the database which is Oracle.
    But it seems the failed 3rd operation prevents the operation 4 to update database.
    My code is something like that:
    int[] updateCounts = null;
    try {
    PreparedStatement stmtInsert = conn.prepareStatement("insert sql");
    for (int i=0; i <SOMEVALUE; i++)
         stmtInsert.setString(1, SOMEVALUE);
         stmtInsert.setString(2, SOMEVALUE);
         stmtInsert.addBatch();
    int[] counts = stmtInsert.executeBatch();
    } catch (BatchUpdateException e)
    updateCounts = e.getUpdateCounts();
    checkUpdateCounts(updateCounts);
    finally {
    conn.close();
    public static void checkUpdateCounts(int[] updateCounts) {
    for (int i = 0; i < updateCounts.length; i++) {
    if (updateCounts[i] == Statement.SUCCESS_NO_INFO) {
    // Successfully executed; number of affected rows not available
    System.out.println("Statement.SUCCESS_NO_INFO");
    } else if (updateCounts[i] == Statement.EXECUTE_FAILED) {
    System.out.println("Statement.EXECUTE_FAILED");
    The results are pretty confusing, as I said first two operations updates the db, but fourth is did not.
    But system out says:
    Statement.EXECUTE_FAILED
    Statement.EXECUTE_FAILED
    Statement.EXECUTE_FAILED
    Statement.EXECUTE_FAILED
    I would expect something like that:
    Statement.SUCCESS_NO_INFO");
    Statement.SUCCESS_NO_INFO");
    Statement.EXECUTE_FAILED
    Statement.EXECUTE_FAILED
    or even better (assuming operation 4 updated the db)
    Statement.SUCCESS_NO_INFO");
    Statement.SUCCESS_NO_INFO");
    Statement.EXECUTE_FAILED
    Statement.SUCCESS_NO_INFO");
    Since the size of the int array that the e.getUpdateCounts() is 4 which is also equal of the batch operations' size, I assume that the driver continues to process the commands in the batch after a BatchUpdateException is thrown.
    I am totally confused, can anybody comment these results? Is there a way to succeed the fourth operation?

  • How to Handle BatchUpdateException

    Hi,
    I am using JSF, Spring and Hibernate with mysql as my db.
    I want to save pcode and pname,etc in the db.
    I used getHibernateTemplate.save(obj);
    I am facing an issue like when i add the same pcode and pname which is existing.... It is throwing Error : BatchUpdateException
    Caused by: java.sql.BatchUpdateException: Duplicate entry 'T1-test1' for key 1
    I am unable to handle or catch this exception.
    <code>
    public PartnerMast save(PartnerMast entity) {
    try{
    System.out.println("Calling Save Method.............");
    entity.setIsActive("Y");
    getHibernateTemplate().save(entity);
    System.out.println("Record Saved..............");
    }catch(Exception e){
    System.out.println("Excep :"+e);
    </code>
    I am not able to catch
    ~~~~~~~~~~~~~~~~~~~~~
    catch(BatchUpdateException e)
    ~~~~~~~~~~~~~~~~~~~~~
    The thing is i want to catch this exception and display the msg n jsf ui.
    Could anyone pls help me could i handle this exception.
    Thanks,
    Ambika&#9786;

    Why're you posting so many times?? Though, it's probably a glitch with this new forum software x-(
    Anyway, since you can delete posts, the least you can do is edit and remove all text from the duplicates so that the length of this thread doesn't increase.
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    (Yes I know it's on JavaRanch but I think it applies everywhere)
    ----------------------------------------------------------------

  • Java.sql.BatchUpdateException

    Hi all,
    In my application I am using batch updation for inserting values into database. But I am getting the following exception.
    java.sql.BatchUpdateException: Lock wait timeout exceeded; try restarting transaction
    Please tell me why this exception is coming and how to solve this.
    Thanks in advance

    hareesh_84 wrote:
    Hi all,
    In my application I am using batch updation for inserting values into database. But I am getting the following exception.
    java.sql.BatchUpdateException: Lock wait timeout exceeded; try restarting transaction
    In the future JDBC related questions should be posted into the JDBC forum. Taking the time to ensure your question is posted into the right forum increases your chances of getting better answers more quickly.
    Smells like some sort of transaction deadlock going on. Are you doing this all inside of a transaction? Do you have other transactions going on at the same time?

  • Error ODDM  Versión 4.0.0.833 -- java.sql.BatchUpdateException: ORA-01722: invalid number

    Hello,
    I have a ten relational data modeler. When I export a reporting scheme I get the following error:
    java.sql.BatchUpdateException: ORA-01722: invalid number
                    at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:10296)
                    at oracle.jdbc.driver.OracleStatementWrapper.executeBatch(OracleStatementWrapper.java:216)
                    at oracle.dbtools.crest.exports.reports.RSTables.export(RSTables.java:108)
                    at oracle.dbtools.crest.exports.reports.RSRelationalModel.export(RSRelationalModel.java:28)
                    at oracle.dbtools.crest.exports.reports.ReportsHandler.export(ReportsHandler.java:123)
                    at oracle.dbtools.crest.swingui.ControllerApplication$ExportToReportsSchema$1.run(ControllerApplication.java:2055)
    Will I could help with the error?
    Logical data modeler is exported correctly
    Thanks.

    Hi,
    I've logged a bug on this.
    It seems likely that the problem has arisen because one of your tables has a non-integer value for one of its volumetric properties (Minimum, Expected or Maximum volume).
    (If this is the case, then the problem will probably still occur with the DM 4.1 EA1 version.)
    David

  • SQL0100W BatchUpdateException in DB2

    All,
    I think there is some problem with DB2 8.1 JDBC driver. I get
    SQL0100W No row was found for FETCH, UPDATE or DELETE; or the result of a query is an empty table. SQLSTATE=02000
    exception when I use preparedstatement.executeBatch() and I have only one statement in the batch [to delete a non existing row from a table]
    code snip....
    while(resultSet.next()){
    long id = resultSet.getLong("ID");
    stmt1 = connection.createStatement();
    stmt1.addBatch("DELETE FROM test WHERE ID ="+id);
    stmt1.executeBatch(); //executes successfully without any exception
    System.out.println("1Here");
    stmt = connection.prepareStatement("DELETE FROM test WHERE ID = ?");
    stmt.setLong(1,id);
    stmt.addBatch();
    stmt.executeBatch(); //throws exception SQL0100W No row was found for FETCH, UPDATE or DELETE; or the result of a
    query is an empty table. SQLSTATE=02000
    System.out.println("2Here");
    Please let me know if this is a bug in the driver implementation or some silly mistake from my side.
    Thanks in advance,
    v_d_s

    Sir,
    Well the error is telling you what you already now... ie. the row doesn't exist. So it's not really a bug. I'm not sure I would hae classified it as an Exception rather than an Warning but the API only says
    BatchUpdateException (a subclass of SQLException) if one of the commands sent to the database fails to execute properly or attempts to return a result set.
    So I guess how fails to execute properly is open to interpretation.
    Sincerely,
    Slappy

  • JDBC BatchUpdateException

    I have the following problem:
    If I try to insert values to a database table with a batch update and somehing goes wrong during statement.executeBatch() (e.g a unique
    constraint is violated), the Oracle driver throws a SQLException instead of an BatchUpdateException and I have no chance to get the updatecount with BatchUpdateException buex.getUpdateCounts().
    Am I wrong or is the driver buggy?
    Any ideas how I can remove the faulty batch element and commit the correct elements?
    Thanks,
    Immo
    I'm using the Oracle8i 8.1.6.0.1 JDBC 2.0 compliant driver for use with JDK 1.2.x
    This is the Exception: java.sql.SQLException: ORA-00001: unique constraint (BERND.SYS_C00946) violated

    Hi,
    I've logged a bug on this.
    It seems likely that the problem has arisen because one of your tables has a non-integer value for one of its volumetric properties (Minimum, Expected or Maximum volume).
    (If this is the case, then the problem will probably still occur with the DM 4.1 EA1 version.)
    David

  • BatchUpdateException.getUpdateCounts() problem

    When error ouccurs using statement.addbatch() and statement.executeBatch() in JDBC 2.0, I want to see how many statements are sucessfully excuted and at what point the error ouccured. So I used BatchUpdateException.getUpdateCount(). however, in the int[] returned, all elements contain -3, which is flag for EXECUTION_FAILED. this int[] supposed to have either the affected line number for each statements, or a -2, the SUCESS_NO_INFO for the all suceesed statements, and have -3 for all failed ones.
    please help

    I agree. I am in the same dilemma. I really need to know which one failed in the batch. I think oracle is not in compliance with the JDBC specs.

  • BatchUpdateException :Results returned for UPDATE ONLY.

    I got an error message at the statement stmt.executeBatch();
    java.sql.BatchUpdateException: Results returned for UPDATE ONLY.
    There are 3 SQL commands in the batch and it throws the above exception while executing the first command.
    (The first command is a SELECT command with COUNT returned to a variable
    eg. SELECT @ABC := COUNT(*) ....
    The second and the third commands use the returned variable to make updates)
    I printed out the updated information using BatchUpdateException.getUpdateCounts and I got
    -3 1 1 (-3 means Statement.EXECUTE_FAILED)
    However, I checked the database (mysql) and I discovered those two update commands were executed correctly ???!!!
    An interesting thing is: if I use stmt.execute or stmt.executeQuery instead of executeBatch, it works fine and doesn't throw any exception.
    I wonder if anybody experience similar situation before or have idea on this problem. Thanx :)

    Can somebody help me, please?

  • A trigger causes a BatchUpdateException

    Hi all.
    I have a big problem. I need to do a program that insert batch information to
    Sybase, Firts I use PreparedStatement but when I send executeBatch() command,
    throws a Exception , then I used Statement and I got the same problem.
    This problem is caused by a insert trigger configured in the sybase table. Maybe
    the driver can't distinguish between update counts from the trigger and insert
    java sentence. I dont know.
    Anybody have an idea to solve this?
    I am using WebLogic 8.1 , jConnect 5.5 and Sybase 11.9.2
    I send you the completa message exception and part of my example program.
    Error 500--Internal Server Error
    java.lang.ClassCastException
         at com.sybase.jdbc2.jdbc.SybStatement.batchLoop(SybStatement.java:1233)
         at com.sybase.jdbc2.jdbc.SybStatement.sendBatch(SybStatement.java:1089)
         at com.sybase.jdbc2.jdbc.SybStatement.executeBatch(SybStatement.java:1056)
         at com.sybase.jdbc2.jdbc.SybPreparedStatement.executeBatch(SybPreparedStatement.java:680)
         at weblogic.jdbc.wrapper.PreparedStatement_com_sybase_jdbc2_jdbc_SybPreparedStatement.executeBatch(Unknown
    Source)
         at jsp_servlet.__insertbatch._jspService(__insertbatch.java:322)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:431)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6291)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:97)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3575)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2573)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:178)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:151)
    Thanks for your help.
    the code for my jsp program example is :
    try {               InitialContext env = new InitialContext();
    ds = (DataSource) env.lookup("jdbc/Envios");
    } catch(NamingException ne) {
    out.println("No pudo obtener conexión a la base de datos: " + ne + "<BR>");
    //crea la conexion
    cnx = Sql.getCnx(ds, 5000);
    Statement stmt = cnx.createStatement();
    try{
    stmt.addBatch("INSERT INTO cdHistoria VALUES('1234567880','MEX',getDate(),'1234567','MLOC','123',NULL,NULL,NULL)");
    stmt.addBatch("INSERT INTO cdHistoria VALUES('1234567881','MEX',getDate(),'1234567','MLOC','123',NULL,NULL,NULL)");
    reg = stmt.executeBatch();
    }catch(SQLException bue){%>
    Error causado por SQLException: <%=bue.getMessage()%>
    <%}
    //Obtiene los datos enviados por la forma de consulta o
    //menú principal
    //IdGuia SiglasPlaza FechaEvento Ruta TipoMov ClaveEx NumOR IdTransporte IdEmpleado
    String SQL = "INSERT INTO cdHistoria VALUES(?,'MEX',getDate(),'1234567','MLOC','123',NULL,NULL,NULL)";
    try{
    cnx.setAutoCommit(false);
    PreparedStatement st = cnx.prepareStatement(SQL);
    st.setString(1,"12345678910");
    st.addBatch();
    st.setString(1,"12345678911");
    st.addBatch();
    reg = st.executeBatch();
    cnx.commit();
    cnx.setAutoCommit(true);
    st.close();
    for (int i=0;1<reg.length;i++){ %>
    Registros agregados: <%=i%>
    <% }
    }catch(BatchUpdateException sqle){
    %>
    Error causado por SQLException: <%=sqle.getMessage()%>
    <%}catch(SQLException bue){%>
    Error causado por SQLException: <%=bue.getMessage()%>
    <%}%>

    Adrian Morales wrote:
    Hi all.
    I have a big problem. I need to do a program that insert batch information to
    Sybase, Firts I use PreparedStatement but when I send executeBatch() command,
    throws a Exception , then I used Statement and I got the same problem.
    This problem is caused by a insert trigger configured in the sybase table. Maybe
    the driver can't distinguish between update counts from the trigger and insert
    java sentence. I dont know.
    Anybody have an idea to solve this?Hi. This is a followup from a post to the sybase jdbc group. Have you tried
    the latest driver from them? The ClassCast exception is a purely Sybase
    driver internal error.
    Joe
    >
    I am using WebLogic 8.1 , jConnect 5.5 and Sybase 11.9.2
    I send you the completa message exception and part of my example program.
    Error 500--Internal Server Error
    java.lang.ClassCastException
         at com.sybase.jdbc2.jdbc.SybStatement.batchLoop(SybStatement.java:1233)
         at com.sybase.jdbc2.jdbc.SybStatement.sendBatch(SybStatement.java:1089)
         at com.sybase.jdbc2.jdbc.SybStatement.executeBatch(SybStatement.java:1056)
         at com.sybase.jdbc2.jdbc.SybPreparedStatement.executeBatch(SybPreparedStatement.java:680)
         at weblogic.jdbc.wrapper.PreparedStatement_com_sybase_jdbc2_jdbc_SybPreparedStatement.executeBatch(Unknown
    Source)
         at jsp_servlet.__insertbatch._jspService(__insertbatch.java:322)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:431)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6291)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:97)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3575)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2573)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:178)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:151)
    Thanks for your help.
    the code for my jsp program example is :
    try {               InitialContext env = new InitialContext();
    ds = (DataSource) env.lookup("jdbc/Envios");
    } catch(NamingException ne) {
    out.println("No pudo obtener conexión a la base de datos: " + ne + "<BR>");
    //crea la conexion
    cnx = Sql.getCnx(ds, 5000);
    Statement stmt = cnx.createStatement();
    try{
    stmt.addBatch("INSERT INTO cdHistoria VALUES('1234567880','MEX',getDate(),'1234567','MLOC','123',NULL,NULL,NULL)");
    stmt.addBatch("INSERT INTO cdHistoria VALUES('1234567881','MEX',getDate(),'1234567','MLOC','123',NULL,NULL,NULL)");
    reg = stmt.executeBatch();
    }catch(SQLException bue){%>
    Error causado por SQLException: <%=bue.getMessage()%>
    <%}
    //Obtiene los datos enviados por la forma de consulta o
    //menú principal
    //IdGuia SiglasPlaza FechaEvento Ruta TipoMov ClaveEx NumOR IdTransporte IdEmpleado
    String SQL = "INSERT INTO cdHistoria VALUES(?,'MEX',getDate(),'1234567','MLOC','123',NULL,NULL,NULL)";
    try{
    cnx.setAutoCommit(false);
    PreparedStatement st = cnx.prepareStatement(SQL);
    st.setString(1,"12345678910");
    st.addBatch();
    st.setString(1,"12345678911");
    st.addBatch();
    reg = st.executeBatch();
    cnx.commit();
    cnx.setAutoCommit(true);
    st.close();
    for (int i=0;1<reg.length;i++){ %>
    Registros agregados: <%=i%>
    <% }
    }catch(BatchUpdateException sqle){
    %>
    Error causado por SQLException: <%=sqle.getMessage()%>
    <%}catch(SQLException bue){%>
    Error causado por SQLException: <%=bue.getMessage()%>
    <%}%>

  • Java.sql.BatchUpdateException: ORA-01027: bind variables not allowed for da

    Hi guys, I m facing a problem while executing below query .Query is working fine in toad i don't know what is the issue with the code
    <code>
    String url3 = "CREATE OR REPLACE VIEW Table2(PERIOD, YEARS, COST_CENTRE, S_DIR_PERM, S_DIR_CONT, S_INDIR_PERM, S_INDIR_CONT, O_DIR_PERM, O_DIR_CONT, O_INDIR_PERM, O_INDIR_CONT)AS select period, year, cost_center, sum(s_dir_perm), sum(s_dir_cont), sum(s_indir_perm), sum(s_indir_cont), sum(o_dir_perm), sum(o_dir_cont), sum(o_indir_perm), sum(o_indir_cont) from ( select b.period, b.year, a.cost_center, sum(a.perm_dir_hc) as s_dir_perm, sum(a.contract_dir_hc) as s_dir_cont, sum(a.perm_indir_hc) as s_indir_perm, sum(a.contract_indir_hc) as s_indir_cont, 0 as o_dir_perm, 0 as o_dir_cont, 0 as o_indir_perm, 0 as o_indir_cont from ZVHR_ACT_HC_ASOF_FISPRD a, pertable b where to_char(as_of_date, 'mm/dd/yyyy') = b.ENDPERIOD and shift not in ('G','N','O2','O7') and b.endperiod = ? group by b.period, b.year, a.cost_center union select b.period, b.year, a.cost_center, 0 as s_dir_perm, 0 as s_dir_cont, 0 as s_indir_perm, 0 as s_indir_cont, sum(a.perm_dir_hc) as o_dir_perm, sum(a.contract_dir_hc) as o_dir_cont, sum(a.perm_indir_hc) as o_indir_perm, sum(a.contract_indir_hc) as o_indir_cont from ZVHR_ACT_HC_ASOF_FISPRD a, pertable b where to_char(as_of_date, 'mm/dd/yyyy') = b.ENDPERIOD and shift in ('G','N','O2','O7') and b.endperiod = ? group by b.period, b.year, a.cost_center) group by period, year, cost_center";
    PreparedStatement statement3 = connection.prepareStatement(url3);
    statement3.setString(1, "12/10/2008");
    statement3.setString(2, "12/10/2008");
    statement3.addBatch();
    statement3.executeBatch();
    </code>
    i m getting the following error
    java.sql.BatchUpdateException: ORA-01027: bind variables not allowed for data definition operations
    can any1 help me with this.

    Can you explain what you are trying to do from a business perspective?
    If you are creating a view, it doesn't make sense to pass bind variables to that DDL statement. The view definition itself is going to have to end up with hard coded date values there. So what possible benefit is there to using bind variables?
    As an aside, if you are using bind variables and you have DATE columns, you really want to pass in the proper data type (i.e. setDate or setTimestamp rather than setString). Otherwise, Oracle has to do implicit string to date conversion, which depends on the session's NLS settings, which is likely to be different on different client machines and lead to all sorts of odd errors and behaviors down the line.
    Are you trying to build a view that takes parameters? If so, there are a few options for that sort of thing.
    Justin

  • BatchUpdateException Problems

    I am trying to play around the batch update method provided in JAVA API 1.3. It works but not without errors. I keep on insert 5 records into my DB2 table by using back the same records. The result is, sometime my code works properly, but sometime it will give me a BatchUpdateException. And I don't know why this could be happened. Attached are the code snippet and also the error log.
    Thanks for any advise and reply.
    // Code Snippet
    if (connection == null) connection = connectDB(); //open connection
    if (stmt != null) stmt = null;
    sqlQuery = "INSERT INTO FAVOURITE (STAFFID, NAME, ACCTNO) VALUES(?,?,?);
    connection.setAutoCommit(false);
    stmt = connection.prepareStatement(sqlQuery);
    for (int j = 0; j < 5; j++) {
       stmt.setString(1, staffID[j]);
       stmt.setString(2, staffName[j]);
       stmt.setString(3, staffAcct[j]);
       stmt.addBatch();
    int [] numUpdates = stmt.executeBatch();
    connection.commit();
    stmt.clearBatch();
    // end code snippet
    // Start error log
    [11/1/04 22:18:41:086 MYT] 21ab3697 LocalTransact E WLTC0033E: Resource jdbc/dev rolled back in cleanup of unresolved LocalTransactionContainment.
    [11/1/04 22:18:41:089 MYT] 21ab3697 LocalTransact E WLTC0032E: One or more resou
    rces rolled back. An unresolved LocalTransactionContainment had an unresolved ac
    tion of rollback.
    [11/1/04 22:18:41:091 MYT] 21ab3697 WebAppTransac E SRVE0183E: LocalTransaction
    rolled-back due to setRollbackOnly
    [11/1/04 22:18:41:095 MYT] 21ab3697 WebGroup      E SRVE0026E: [Servlet Error]-[
    LocalTransaction rolled-back due to setRollbackOnly]: com.ibm.ws.LocalTransactio
    n.RolledbackException
            at com.ibm.ws.LocalTransaction.LocalTranCoordImpl.cleanup(LocalTranCoord
    Impl.java(Compiled Code))
            at com.ibm.ws.webcontainer.webapp.WebAppTransactionCollaborator.postInvo
    ke(WebAppTransactionCollaborator.java(Compiled Code))
            at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAp
    pRequestDispatcher.java(Compiled Code))
            at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebApp
    RequestDispatcher.java(Compiled Code))
            at com.ibm.ws.webcontainer.servlet.InvokerServlet.service(InvokerServlet
    .java:255)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code
            at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(Stric
    tServletInstance.java(Compiled Code))
            at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(Stric
    tLifecycleServlet.java(Compiled Code))
            at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecy
    cleServlet.java(Compiled Code))
            at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(Strict
    LifecycleServlet.java(Inlined Compiled Code))
            at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstan
    ce.java(Compiled Code))
            at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(V
    alidServletReferenceState.java(Compiled Code))
            at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(Ser
    vletInstanceReference.java(Inlined Compiled Code))
            at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDi
    spatch(WebAppRequestDispatcher.java(Compiled Code))
            at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAp
    pRequestDispatcher.java(Compiled Code))
            at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebApp
    RequestDispatcher.java(Compiled Code))
            at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.jav
    a(Compiled Code))
            at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebApp
    Invoker.java(Compiled Code))
            at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvoc
    ation(CachedInvocation.java(Compiled Code))
            at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(Ser
    vletRequestProcessor.java(Compiled Code))
            at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSE
    Listener.java(Compiled Code))
            at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnect
    ion.java(Compiled Code))
            at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.ja
    va(Compiled Code))
            at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:449)
            at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
    //end error log

    I would suggest that you google using the following string....
    "An unresolved LocalTransactionContainment"

  • Oracle.jdbc2.BatchUpdateException: ORA-00001:

    I am posting news with news post form
         when i create db tables and insert records then its working well
         but when I am droping the all table and importing db then it throws the
         subject error
    thanks & best regards

    Did you customize this workflow?
    For an item key that has failed, run $FND_TOP/sql/wfstatus.sql. Output the relevant portion of the output here.

Maybe you are looking for

  • How do I change a password when email no longer exists?

    I have two Adobe accounts.  One of them is for my creative cloud account and the email on that account no longer exists.  when I try to sign in to my creative cloud account it tells me to change the password, but the instructions for changing the pas

  • MacBook Pro boosts up but then automatically turns off

    So I was just sitting browsing the Internet, online shopping and stuff. All of a sudden my computer went black, but the light in the corner said it was still on. I held the power button to restart it. It turned off and I waited a few minutes. When I

  • Sony Cam question with i movie.

    Hello At the moment i use a windows pc to make hd movies with my sony cx-130 camcorder and sony vegas pro. Will hopefully buying a mac early next year but am worried about my camcorder. Been reading these forums and discovered to transfer the files o

  • SR2016T-EU 16 PORT GIGABIT UNMANAGED SWITCH

    I bought the above mentioned model few days before for my small business of internet cafe with 16 computers by accepting the advice given by the person who sold me this apparatus inorder to have equal and good connection for all the computers.i just

  • HT201320 cannot send mail, username or password is incorrect

    cannot send mail, username or password is incorrect,  but it is not incorrect!!! help