Array Insert/Update/Select in JDBC

I've been using array processing in ODBC, OCI, and Pro*C for years and desperately need to do so in JDBC. I've thus far been unsuccessful and am beginning to doubt that it's supported which to me is unfathomable. I've likewise found many like inquiries on the net - none of which were addressed. There have been many respondants who don't undertstand what array processing is and mistake it for batch SQL statements. They are not the same. Batched SQL statements are seperate statements which are executed in a single call to the database engine. What I'm taking about is using a prepared statement and binding primitive arrays to the statement. A single statement is executed and the contents of the arrays passed to the database. I've conducted tests years ago and array insert/update is many times faster than batch statements. Does anyone know whether or not JDBC supports array processing? If anyone's interested, I can provide snippets via email which illustrate how this is done in ODBC and other API's.
Thanks.

You referred me to
http://java.sun.com/products/jdbc/download.html. The
only reference I found to arrays were SQL Arrays - not
what I'm talking about. See prior C/ODBC snippet. Do
you know how to do this in JDBC?You are talking about passing an array as a single parameter to and from the underlying database correct? (And that has nothing to do with batch processing.)
If so in section 16.4 "Array Object"..... looking at that section gives the following reference....
The Array object returned to an application by the ResultSet.getArray and
CallableStatement.getArray methods is a logical pointer to the SQL ARRAY
value in the database; it does not contain the contents of the SQL ARRAY value.
The above has nothing to do with batch processing (although presumably one could use it in a batch process but then one can use String as well.)
Of course perhaps there is something in there that says that only applies to batch processing. If so could you please point out the section and quote the text.

Similar Messages

  • HOw to improve insert/update/select  for nested table.

    Hi All,
    I think this is my second thread for nested table.
    i just want to know what are the different ways available to improve the insert/update/select operation on Nested table.
    Thanks in advance.

    By not using a nested table for data storage in the first place...
    http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:8135488196597
    Perhaps Parallel Query/DML might give some relief.

  • Pro*C: host array insert using VARCHAR

    I followed the sample program sqlvcp.pc (explained in the ORACLE docu for Pro*C) to select severel rows from the database into an host array of varchar. This needs only one FETCH in program and works very well.
    I tried to use the same method to insert a host array of varchar into the database.
    BUT unfortunately only one row is inserted and then I get the error -01458.
    I checked data in my host array (allocated with malloc) using a debugger and I can't find an error.
    Is it possible to use this method to insert several rows out of a host array of varchar into the database using only one insert statement?
    If yes, for what do I have to take care of?
    Or do I have to use a loop with one insert for every row. This would be much slower!
    Thanks for Help.

    Hi prajithparan,
    Thanks for the response. I already looked at the link and a few other links in this forum that are related to array inserts/updates. However, I could not find answers to my specific questions. I am specifically concerned with the setup of parameters to the API calls (OCIBindByName and OCIBindArrayOfStruct) that fully reflects the two-dimensional nature of the array of structs that I am trying to insert.
    Moreover, I need to set the data type of the columns to be inserted as SQLT_STR. I think this data type requires the programmer to supply the length of the null terminated C strings as well. If we are inserting just one column, we can provide the length of each of the strings to be inserted into a VARCHAR2 column as part of a OCIBind call, for each of those columns.
    Since in an array insert, we are supplying multiple rows at the same time, how do we supply the lengths of strings to be inserted ? Should it be some form of two-dimensional array ?
    I could not get clear answers to these questions from either the Oracle documentation or the links on this forum. May be the answers are there and I am just missing them ?

  • Stored proecedure tutorial for insert, delete, update,select

    I want to integrate the stored procedure in my project
    i am using jsp,
    any one suggest me, stored proecedure tutorial for insert, delete, update,select
    thanx.

    Whether you are using JSP or not should not affect your decision (though I would recommend checking out the MVC pattern, and recommend against doing data access code from your JSP's).
    You simply need one tutorial on how to invoke a stored procedure. The stored procedure you write can have INSERT, SELECT, UPDATE, DELETE, whatever. You simply have to master the concepts involved in java.sql.CallableStatement. (And then you can get more fancy with vendor-specific extensions).
    However, I am a bit confused. You want a tutorial on stored procedures, but then you indicate very normal DML statements like INSERT, UPDATE and DELETE. All of these (queries, DML and stored procedures) fall under the general umberella of JDBC. So, it is always a good place to start with a plain ole JDBC tutorial.
    java.sun.com/docs/books/tutorial/jdbc/index.html
    www.onjava.com/pub/a/onjava/2003/08/13/stored_procedures.html
    - Saish

  • Execution time difference between SELECT & UPDATE statement in JDBC Sender.

    Hi Experts,
    In my scenario, I have used the JDBC Sender Adapter with the SELECT and UPDATE statement.
    Now the problem is in between the execution of Select and update statement, few more entries are coming in the same DB Table.
    So result of this is updation take place for those entries which are not even picked up by the select statement.
    Can we avoid this execution time difference between the SELECT & UPDATE statemet on JDBC Sender side???
    Thanks & Regards
    Jagesh

    Hi
    Use serializable option in additional parameters, now all new entries would also be updated.

  • JDBC/OCI8 Array inserts

    Does JDBC/OCI8 support array inserts? I'm familiar with the C/C++ array inserts, but I haven't found anything on array inserting using JDBC/OCI8.
    Array processing gives an application a real performance boost and I was hoping to use it in Java.

    Hi ,
    I am facing the same problem with
    Oracle 8.1.5 on Windows NT.
    Driver : 8.1.6 JDBC OCI Driver
    JDK 1.2.2
    Any workaround / patch to solve this problem please ?
    Thanks,
    Shubhada

  • Urgent : Performance Issue DELETE , INSERT INTO SELECT, UPDATE

    Hi,
    NEED ASSISTANCE TO OPTIMIZE THE INSERT STATEMENT (insert into select):
    =================================================
    We have a report.
    As per current design following steps are used to populate the custom table whcih is used for reporting purpose:
    1) DELETE all the recods from the custom table XXX_TEMP_REP.
    2) INSERT records in custom table XXX_TEMP_REP (Assume all the records related to type A)
    using
    INSERT..... INTO..... SELECT.....
    statement.
    3) Update records in XXX_TEMP_REP
    using some custom logic for the records populated .
    4) INSERT records in custom table XXX_TEMP_REP (Records related to type B)
    using
    INSERT..... INTO..... SELECT.....
    statement.
    Stats gathered related to Insert statement are:
    Event Wait Information
    SID 460 is waiting on event : db file sequential read
    P1 Text : file#
    P1 Value : 20
    P2 Text : block#
    P2 Value : 435039
    P3 Text : blocks
    P3 Value : 1
    Session Statistics
    redo size : 293.84 M
    parse count (hard) : 34
    parse count (total) : 1217
    user commits : 3
    Transaction and Rollback Information
    Rollback Used : 35.1796875 M
    Rollback Records : 355886
    Rollback Segment Number : 12
    Rollback Segment Name : _SYSSMU12$
    Logical IOs : 1627182
    Physical IOs : 136409
    RBS Startng Extent ID : 14
    Transaction Start Time : 09/29/10 04:22:11
    Transaction_Status : ACTIVE
    Please suggest how this can be optimized.
    Regards,
    Narender

    Hello,
    Is there any relation with the Oracle Forms tool ?
    Francois

  • Error meesage on UI sCannot insert/update Array without context information

    Hi All,
    As soon as page runs , i m getting the below error on server logs and also getting the same error once page page loads , user click on SellectmnayListBOx components on screen .
    Appriciate if any inputs on this . using ADF6 .
    <ApplicationModuleImpl> <doPoolMessage>
    oracle.jbo.AfterRollbackException: JBO-26102: An error occurred after rollback was performed.
         at oracle.jbo.server.DBTransactionImpl.rollback(DBTransactionImpl.java:2595)
         at oracle.jbo.server.ApplicationModuleImpl.resetState(ApplicationModuleImpl.java:4840)
         at oracle.jbo.server.ApplicationPoolMessageHandler.doPoolMessage(ApplicationPoolMessageHandler.java:336)
         at oracle.jbo.server.ApplicationModuleImpl.doPoolMessage(ApplicationModuleImpl.java:9084)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.sendPoolMessage(ApplicationPoolImpl.java:4607)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.resetApplicationModule(ApplicationPoolImpl.java:2026)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.removeSessionCookie(ApplicationPoolImpl.java:879)
         at oracle.jbo.common.ampool.SessionCookieImpl.removeFromPool(SessionCookieImpl.java:711)
         at oracle.jbo.common.ampool.SessionCookieImpl.destroy(SessionCookieImpl.java:650)
         at oracle.jbo.common.ampool.SessionCookieImpl.timeout(SessionCookieImpl.java:697)
         at oracle.adf.model.bc4j.DCJboDataControl.releaseImmediateAMUnmanaged(DCJboDataControl.java:2525)
         at oracle.adf.model.bc4j.DCJboDataControl.releaseApplicationModule(DCJboDataControl.java:2429)
         at oracle.adf.model.bc4j.DCJboDataControl.release(DCJboDataControl.java:903)
         at oracle.adf.model.dcframe.DataControlFrameImpl.release(DataControlFrameImpl.java:364)
         at oracle.adf.model.BindingContext.resetState(BindingContext.java:637)
         at oracle.adf.model.BindingContext.release(BindingContext.java:609)
         at oracle.adf.model.servlet.HttpBindingContext.valueUnbound(HttpBindingContext.java:77)
         at weblogic.servlet.internal.session.SessionData.removeAttribute(SessionData.java:720)
         at weblogic.servlet.internal.session.SessionData.removeAttribute(SessionData.java:702)
         at weblogic.servlet.internal.session.SessionData.remove(SessionData.java:976)
         at weblogic.servlet.internal.session.MemorySessionContext.invalidateSession(MemorySessionContext.java:69)
         at weblogic.servlet.internal.session.SessionContext.invalidateSession(SessionContext.java:475)
         at weblogic.servlet.internal.session.MemorySessionContext$SessionCleanupAction.run(MemorySessionContext.java:114)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.session.MemorySessionContext.destroy(MemorySessionContext.java:90)
         at weblogic.servlet.internal.WebAppServletContext.destroy(WebAppServletContext.java:3220)
         at weblogic.servlet.internal.ServletContextManager.destroyContext(ServletContextManager.java:247)
         at weblogic.servlet.internal.HttpServer.unloadWebApp(HttpServer.java:461)
         at weblogic.servlet.internal.WebAppModule.destroyContexts(WebAppModule.java:1535)
         at weblogic.servlet.internal.WebAppModule.deactivate(WebAppModule.java:507)
         at weblogic.application.internal.flow.ModuleStateDriver$2.previous(ModuleStateDriver.java:387)
         at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:223)
         at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:215)
         at weblogic.application.internal.flow.ModuleStateDriver.deactivate(ModuleStateDriver.java:141)
         at weblogic.application.internal.flow.ScopedModuleDriver.deactivate(ScopedModuleDriver.java:206)
         at weblogic.application.internal.flow.ModuleListenerInvoker.deactivate(ModuleListenerInvoker.java:261)
         at weblogic.application.internal.flow.DeploymentCallbackFlow$2.previous(DeploymentCallbackFlow.java:547)
         at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:223)
         at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:215)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.deactivate(DeploymentCallbackFlow.java:192)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.deactivate(DeploymentCallbackFlow.java:184)
         at weblogic.application.internal.BaseDeployment$2.previous(BaseDeployment.java:642)
         at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:223)
         at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:215)
         at weblogic.application.internal.BaseDeployment.deactivate(BaseDeployment.java:227)
         at weblogic.application.internal.EarDeployment.deactivate(EarDeployment.java:58)
         at weblogic.application.internal.DeploymentStateChecker.deactivate(DeploymentStateChecker.java:198)
         at weblogic.deploy.internal.targetserver.AppContainerInvoker.deactivate(AppContainerInvoker.java:98)
         at weblogic.deploy.internal.targetserver.operations.AbstractOperation.silentDeactivate(AbstractOperation.java:679)
         at weblogic.deploy.internal.targetserver.operations.RedeployOperation.unprepareDeployment(RedeployOperation.java:197)
         at weblogic.deploy.internal.targetserver.operations.RedeployOperation.doPrepare(RedeployOperation.java:120)
         at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:747)
         at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1216)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:250)
         at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:171)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:13)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:46)
         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: oracle.jbo.JboException: Cannot insert/update Array without context information     at oracle.jbo.domain.Array.prepareForDML(Array.java:802)
         at oracle.jbo.server.ViewRowSetImpl.prepareLobObjectForBind(ViewRowSetImpl.java:8301)
         at oracle.jbo.server.ViewRowSetImpl.getParametersAsStorageTypes(ViewRowSetImpl.java:5074)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:1169)
         at oracle.jbo.server.ViewRowSetImpl.executeQueryForMasters(ViewRowSetImpl.java:1397)
         at oracle.jbo.server.ViewRowSetImpl.executeQueryForMode(ViewRowSetImpl.java:1303)
         at oracle.jbo.server.ViewRowSetImpl.executeQuery(ViewRowSetImpl.java:1288)
         at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java:7107)
         at com.tuitravelad.modelbase.bc.base.vo.TuiTravelADViewObject.afterRollback(TuiTravelADViewObject.java:168)
         at oracle.jbo.server.DBTransactionImpl.rollback(DBTransactionImpl.java:2570)
         ... 62 more
    ## Detail 0 ##
    oracle.jbo.JboException: Cannot insert/update Array without context information
         at oracle.jbo.domain.Array.prepareForDML(Array.java:802)
         at oracle.jbo.server.ViewRowSetImpl.prepareLobObjectForBind(ViewRowSetImpl.java:8301)
         at oracle.jbo.server.ViewRowSetImpl.getParametersAsStorageTypes(ViewRowSetImpl.java:5074)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:1169)
         at oracle.jbo.server.ViewRowSetImpl.executeQueryForMasters(ViewRowSetImpl.java:1397)
         at oracle.jbo.server.ViewRowSetImpl.executeQueryForMode(ViewRowSetImpl.java:1303)
    Thanks

    Hi,
    this
    +"As soon as page runs , i m getting the below error on server logs and also getting the same error once page page loads , user click on SellectmnayListBOx components on screen ."+
    cannot be the full story you tell. The exception is thrown in the context of a prepareForDML, which is called on entities for the Create / Update and Delete use case. I also see a failed rollback. So there must be something you do before this happens during a page refresh
    Frank

  • Oracle.jbo.JboException: Cannot insert/update Array without context informa

    Hi guys,
    i get this error:
    "oracle.jbo.JboException: Cannot insert/update Array without context information"
    on the line:
    t.commit();
    where
    Transaction t=this.getTransaction();
    Thank you

    Hi,
    this
    +"As soon as page runs , i m getting the below error on server logs and also getting the same error once page page loads , user click on SellectmnayListBOx components on screen ."+
    cannot be the full story you tell. The exception is thrown in the context of a prepareForDML, which is called on entities for the Create / Update and Delete use case. I also see a failed rollback. So there must be something you do before this happens during a page refresh
    Frank

  • New Feature: Generate Statements (select, insert, update)

    I finally moved to ubuntu, so no more toad for me. It will be nice if sql developer could have the generate statements menu ( select, insert update) found in Toad. This should be extremely simple to do. In my case it actually save me time when testing and creating store procedures.
    Maybe the feature is there and I just dont know where it is.
    Thank you.

    There's an existing request for this on the Exchange; vote on that one to add weight, to increase chances of implementation.
    Uncontaminated? How can you say that if you don't know what it's like being contaminated? You'd wish you were ;-)
    Although I really like sqldev, the numerous bugs and performance issues I hit every day still force me now and then to use the much more mature Toad. At least I'm sure it does what I want it to do and that it won't screw up our production environment.
    K.

  • Concept insert,update,delete and select

    hi all, i want to ask
    Where I get an explanation of the concept of work process insert, update, delete and select records. From the user starts the query until accessing records the physical . or is there that can give the picture of concept process insert,update,delete and select record??

    I'm not sure what are you asking here.
    Are you asking how do I do these operations in a JDeveloper built application? Which technologies are you using?
    Have a look at this tutorial for the basics of how to do select/update - insert and delete are two more operations you can add to your page from the data control:
    http://www.oracle.com/technology/obe/obe11jdev/ps1/ria_application/developriaapplication_long.htm

  • SELECT - INSERT/UPDATE statement mapping.

    This might be a silly question, but are there any Java libraries that can perform an arbitrary SELECT statement to INSERT/UPDATE statement mapping? Or indeed, is this in fact possible?
    Just to be a little clearer, if we had the statement;
    SELECT [Field1] FROM [Table1]
    It would map down to;
    INSERT INTO [Table1] VALUES [Field1]='foo'
    Please excuse my INSERT syntax if it is incorrect, I hardly ever use these statements.
    The reason that I ask is because I am writing a piece of software that can perform quite complex extractions from databases, and it would be nice to be able to automatically 'reverse' the extraction, and perform updates on the extracted data.
    Unfortunately, because of the architecture and requirements of the application, I can not just update a resultset and call the update() method.
    Thanks for your time.
    Ben

    You can define a Bean or simple class to define a table record type (table structure), defining all fields, the primary key and maybe more.
    then deriving a select or insert or update can be done with ease.

  • CLOB update ,insert and select

    hi,
    could any one tell me which is the best approach to insert, update and select CLOB valoues
    and also which CLOB to use (ie java.sql.CLOB or oracle.sql.CLOB) in an oracle database

    I'd generally recommend to use the methods in java(x).sql only (for portability reasons).
    Update:
    ResultSet r = ...;
    Clob text = r.getClob(1);
    Writer w = text.setCharacterStream(0);
    w.write("some text");Insert:
    Problem: Clob instantiation.
    Either ensure that an empty clob is created as default for clob colums
    or use database-specific code like "insert into tab(id, text) values(1, dbms_lob.create_clob...)"
    and update that row as above.
    Select
    Use getString for clobs or (to prevent truncating)
    ResultSet r = ...;
    Clob c = r.getClob(1);
    Reader r = c.getCharacterStream(0);Regards,

  • What mechanism Oracle 10g use for write (Insert/ Update) and Read (Select)?

    Hi
    What mechanism Oracle 10g use for write (Insert/ Update) and Read (Select)?
    Thank you

    Aren't the answers given in PL/SQL forum sufficient enough?Well, as the first answer in that forum directed the OP to this forum you can hardly blame them for the repost.
    There is some high-level stuff in the Concepts Guide. If that is insufficient the OP will need to tell us what more details they need to know (and perhaps why).
    Cheers, APC

  • Insert, update and select Chinese characters

    Dear all,
    I fail to use my application to insert, update or select Chinese characters into Oracle DB using oracle instant client 9i. Do I need to do to setup for NLS_LANG?
    My OS is WIN 2K prof.
    Regards,
    Kenneth

    Set the environment variable NLS_LANG to include the correct value for the Chinese codepage that you want.
    Does the problem go away?
    Yours,
    Laurenz Albe

Maybe you are looking for

  • Webelements : does not support when i add the data sourcce& view in HTML

    hi Masters, i am using sap crystal reports 2008 and when i add the data source and add tables to the report and i use web elements functions as my selection screen then it does not show i mean the script remains as it is and when i take out my data s

  • OWB 904 doesn't use DB Links in mapping scripts

    I'm having trouble deploying mappings because they don't use the generated DB Links in the mapping scripts. Normally when deploying a mapping I get this warning that certainly is correct since it can't find the source table: VLD-2771: System privileg

  • Where can I get a cheap old iPod

    Hi, Christmas is coming and I wanted to buy a family member an iPod shuffle that looks like the one in the attached image. I also wanted to know what some other cheap iPods are. I don't have that much money so $25 is kinda my limit Thanks in advance,

  • Problem in WEBDypro

    Dear Experts, I am new to ABAP. I want to create a mask screen through which I can manage the database tables ( Add new entries, See the existing ones, delete them and Edit them) For this purpose I went on to create a WebDynpro.  But when I went to C

  • How do i launch photoshop online?

    How do i launch photoshop online?