Question about sql batch process in java app

hi all
i have few questions about using batch process in the java.sql package. the addBatch method can take sql statements like inserts or updates. can we use a mixture of insert and update then? can we use prepared statement for this? it's just for performance consideration. thanks in advance.

hi all
i have few questions about using batch process in the
java.sql package. the addBatch method can take sql
statements like inserts or updates. addBatch() is a method that has no parameters. It doesn't 'add' sql statements.
can we use a
mixture of insert and update then? can we use
prepared statement for this? it's just for
performance consideration. thanks in advance.The point of batching is that you take something that is invariant and then 'add' a variant part.
Thus a single insert has an invariant part (the table and specific columns) and a variant part (the data for each row by column.)
You can use anything that is valid SQL (for jdbc, driver, database) and use it presuming your database allows that particular usage in batching. But that does require some regular pattern - it won't work if your usage is random. Nor will it work if some statements need to be executed only some of the time. Finally also note that transaction processing will often require smaller chunks - you can't insert a million rows in one batch.

Similar Messages

  • Some question about sql code

    for example:
    select
    from testtable
    outputs below results:
    item_desc
    950gapple(z)110ml*40
    650gbanana(z)215ml 1x18
    make above example outputs below result:
    item_desc
    a950gapplez110ml40
    a650gbananaz215ml1x18
    how to write above sql code?
    who can help me?
    thanks

    Jameel Provided solution to one of your other thread
    a question about sql code
    Try the below query. You can modify the TRANSLATE function to add the characters you want to remove from the string.
    select 'a'||replace(translate(str,'()* ','`'),'`') from testtable

  • Creating a Batch Process in Java

    Hi,
    I have to create a Batch process in Java but I have no idea how can I do that: "Kind of java project I have to create ....
    Thank you for your help.

    Hi,
    I have to create a Batch process in Java but I have
    no idea how can I do that: "Kind of java project I
    have to create ....
    Thank you for your help.Hi,
    I suggest you some methods to create executables for java
    These are the steps::
    1=>Compile all the java classes
    2=>create a Manifest.txt file with Main-Class : (class name where the execution starts ie class which has public static void main(String args[])function
    3=>create a jar
    After creating a jar file there are 2 ways you can make it to run by single click
    1==> you can create a .bat file
    2==>you can convert the jar file in to .exe file by a software
    creating .bat file
    assume let the file is D:\java\hello.jar
    run.bat
    go
    java -jar "D:\java\hello.jar"
    2==> this is the better method and the software which i have is vey convienent to use
    if you need it i can mail you

  • Complicated question: dialog box-batch processing script

    I am adapting the working script I found on this forum.
    Script: Open files as layers in Photoshop
    https://forums.adobe.com/thread/1313579
    The goal of the adaptation is to include a javascript Folder dialog to set the save folder destination at run time and
    use this folder destination for the remaining script batch processing functions.
    Presently, the script loads a Bridge stack as Photoshop layers and saves the layered tiff using the Folder dialog.
    The folder dialog is manifesting every time the script encounters a Bridge stack.
    The question is what is the correct script logic to set the destination folder once at run time and keep this destination
    folder for the stack batch processing.
    #target bridge
    var stacks = app.document.stacks;
    var stackCount = stacks.length;
    for(var s = 0;s<stackCount;s++){
          var stackFiles = getStackFiles( stacks[s] );
          if(stackFiles.length> 1){
               var bt = new BridgeTalk;
               bt.target = "photoshop";
               var myScript = ("var ftn = " + psRemote.toSource() + "; ftn("+stackFiles.toSource()+");");
               bt.body = myScript;
               bt.send(5);
    function getStackFiles( stack ){
          var files = new Array();
          for( var f = 0; f<stack.thumbnails.length;f++){
               files.push(stack.thumbnails[f].spec);
          return files;
    function psRemote(stackFiles){
    app.bringToFront();
    var thisDoc = open(File(stackFiles[0]));
    var Name = decodeURI(app.activeDocument.name).slice(0,-4);
    thisDoc.layers[0].name = decodeURI(Name);
    for(var a = 1;a<stackFiles.length;a++){
        open(File(stackFiles[a]));
        Name = decodeURI(app.activeDocument.name).slice(0,-4);
        activeDocument.activeLayer.duplicate(thisDoc);
        app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
        thisDoc.layers[0].name = Name;
    var tifOptions = new TiffSaveOptions();
    tifOptions = new TiffSaveOptions();
    tifOptions.embedColorProfile = true;
    tifOptions.imageCompression = TIFFEncoding.TIFFLZW;
    tifOptions.alphaChannels = false;
    tifOptions.byteOrder = ByteOrder.MACOS;
    tifOptions.layers = true;
    var theFolder = Folder.selectDialog ("Select Folder");
    if (theFolder) {
            var myFile = new File( theFolder + "/" + app.activeDocument.name);
            app.activeDocument.saveAs(myFile, tifOptions, true);  
    app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);

    I am thinking the Folder dialog is not correct for this application.
    On a second thought a persistent dialog to set the save folder path and run the script from the persistent dialog can make sense.
    Any ideas?

  • Questions about the load processing of OpenSparc T1 Dcache

    Hi,
    I have some questions about OpenSparc T1 Dcache load processing.
    During load processing, subsequent loads to the same address need to search the store buffer for a valid store to that address. If there is a CAM hit, data is sourced from the store buffer, not from the D-cache, and no load request will be sent to the L2.
    What if there is no CAM hit. Would the load request be sent to L2? Or would Dcache be checked for the requested data?
    If the load request would be sent to L2, what next? Would the Dcache be updated?
    Thanks

    Store buffer is checked for Read after Write (RAW) condition on loads. If there is full RAW - i.e. full data exists in the store buffer - then the data is bypassed and no D cache access happens.
    If RAW is partial (e.g. word store followed by a double word load) then load is treated as a miss. Store is allowed to complete in L2 cache and then load instruction is completed.
    For the miss in STB, D cache is accessed. If hit, data is fetched from D$. If miss, data is fetched from L2$ and allocated in D$.

  • A question about the execution order of java code

    I have a question about the order of the execution of java code.
    class myclass
    String str1 = new String("str1");
    static String str2 = new String("str2");
    static
    String str3 = new String("str3");
    myclass( )
    String str4 = new String("str4");
    static myfuntion()
    String str5 = new String("str5");
    When I new a myclass object, what is the order of execution about str1,str2.str3 ,str4?
    When I run myclass::myfunction( ) instead of new a myclass object what is the execution order about str1, str2, str3, str4, str5?
    Thanks

    hello,
    I think there may be one thing can't use println to make sure.
    class myclass
    static {  System.out.println("str1");   };
    myclass() { System.out.println("str2"); }
    then str1 appear before str2
    class myclass
    static {  String str1 = new String("str1"); };
    myclass() { String str2 = new String("str2"); }
    then
    str1 initilized before str2,
    str1 get the value str1----->after<----- str2.
    Am I right or wrong?

  • Question about calling batch file by using the System Exec+.vi?

    Hi
    I have a problem about calling batch file. I know that the system exec is equivalent to "run" in Windows. I called the batch file c:\rtxdos\bs\ch0.bat successfully in the "run" but it didn't work in the LabVIEW program. The dos prompt had an error message "Bad command or file name" and it just happen when I call this batch file in LabVIEW. Why?
    Bill.

    Hi,
    Try to set the "working directory" parameter of System exec.vi to the directory where the batch file is located. It may help.
    Good luck.
    Oleg Chutko.

  • Batch Processing in java

    Hello Everybody
    I am working on Files in my project, and doing some IO operations on them.
    I am getting the file names from JFileChooser. Now i want to do batch processing on those files.
    Can any body help me out how to do batch processing, any suggestions or comments.
    Waiting for reply.
    Thanks in advance.

    Can any body help me out how to do batch processing,
    any suggestions or comments.What exactly do you mean when you say batch processing?

  • Question about how XI process files in FTP

    Hi experts,
    I have a file-FTP to JDBC scenario.
    XI scans a folder every minute to see if any file has appear.
    My question is, does XI process the files in their order of creation, or randomly ?
    If not, is there a way to make XI process them in order of creation ?
    Thanks a lot, any help would be appreciated.
    Kind regards,
    Jamal

    Hi,
    from SAP Help:
    If you select files from an FTP server and not from the file system, you need to make the following additional specifications:
    ○       ftp.host=<ftp-server>
    The host name or IP address of the FTP server. If this specification is made, it is assumed that you are accessing an FTP server. The specifications file.sourceDir and file.sourceFileName then refer to the FTP server. The following are then not possible specifications:
    ■       setAttribute for parameter file.processingMode.
    ■       byDate for parameter file.processingOrder.
    Regards
    Patrick

  • A question about the Installation process in general

    Hey guys, a general question to the installation process.
    The following scenario:
    I install a programme on my macbook pro and don't tick all possible installation options (like additional content).
    Afterwards I change my mind and want to install the optional content.
    So I run the installation programme again and now the question:
    If I install the additional content AND the mainprogramme again is the main programme going to be overwritten or am I going to have the mainprogramme twice on my system from now on
    Thanks in advance for you help, folks!

    If you do a Unicode conversion (no matter in a UC & CU scenario or as a single project) the target system must be empty - means, you will create a new database and load it with the content you exported.
    You can't install the export into your already existing database with the same name.
    Markus

  • A question about CPS (CPS processing) and CAPolicy.inf file.

    Hello All
    Can someone please help me with the following question.
    Background, I am building a 3-tier PKI infrastructure. offline Root, offline Policy (intermediate), online issuing.
    Now my first question is about CPS (certificate practice statement) for this example lets just call this the InternalIssuancePolicy as below.
    Basically I was thinking it is best not to set a given certificate (aka issuance) policy at the Root, the reason being I may wish to have different issuance policies at a latter date.
    For example right now I just want an issuance policy (CPS) for internal certificates only, therefore I am thinking set this at the Policy CA level, as below [InternalIssuancePolicy] (example OID) and then issuing CA certs from this Policy CA to the
    internal issuing CAs. If at a latter date I want a different policy (CPS) for issuance of external certificates I can build a new Policy CA under the existing Root with a different policy extension.
    Is the above logic sound?
    Questions:
    I am assuming from recent study that the CA cert issued to the Issuing CA will contain a single issuance policy "only" i.e. the one that was specified in the Policy CA 1.3.6.1.4.11111111.1.1.1.  If so I believe you cannot build a new
    issuing CA and submit the CSR to the Policy CA asking for a CA cert with any other certificate policy extension other than 1.3.6.1.4.11111111.1.1.1
    Is that correct?
    Also
    I saw a blog post which stated if are going to use certificate/issuance policies (other than all issuance policies) you should mark the extension as critical=true otherwise the policy just becomes glorified comment. I take the point but that leads me to
    two more questions
    1: How does the certificate changing engine or CryptoAPI enforce a certificate policy (as it is just a policy, e.g. written procedure). I am assuming all this means is it forces the client to process the extension and therefore check the certificate
    policy extension in the certificate does not violate the certificate chain but that is all it can do?
    2: If the certificate policy extension is set to critical and the URL referenced in the extension is not available (e.g. on a WEB Server and the client is working offline, but has a cached CRL), does setting the extension to critical also force the
    client to try and access the URL listed, or not (I am assuming not as you could just have a text block rather than URL).
    Any comments suggestions on my proposed three CAPolicy.inf files below for the 3-tier PKI (again offline Root and Policy)
    ** Root **
    [Version]
    Signature= "$Windows NT$"
    [Certsrv_Server]
    RenewalKeyLength=4096
    RenewalValidityPeriodUnits=Years
    RenewalValidityPeriod=20
    CRLPeriod=Years
    CRLPeriodUnits=1
    LoadDefaultTemplates=False
    AlternateSignatureAlgorithm=0
    [CRLDistributionPoint]
    [AuthorityInformationAccess]
    basicconstraintsextension]
    pathlength = 2
    critical=true
    PolicyStatementExtension]
    Policies = AllIssuancePolicy
    Critical = FALSE
    [AllIssuancePolicy]
    OID = 2.5.29.32.0
    ** Policy CA **
    [Version]
    Signature= "$Windows NT$"
    [Certsrv_Server]
    RenewalKeyLength=2048
    RenewalValidityPeriodUnits=Years
    RenewalValidityPeriod=10
    CRLPeriod=Years
    CRLPeriodUnits=1
    [PolicyStatementExtension]
    Policies = InternalIssuancePolicy
    Critical = False
    [InternalIssuancePolicy]
    OID = 1.3.6.1.4.11111111.1.1.1
    Notice = "Internal Certificate Policy"
    URL="http://pki.lab.local/Certenroll/CPS.txt"
    [AuthorityInformationAccess]
    URL=http://pki.lab.local/Certenroll/PolicyCA01.crt
    [CRLDistributionPoint]
    URL=http://pki.lab.local/Certenroll/PolicyCA01.crl
    [basicconstraintsextension]
    pathlength = 1
    critical=true
    ** Issuing CA **
    [Version]
    Signature= "$Windows NT$"
    [Certsrv_Server]
    RenewalKeyLength=2048
    RenewalValidityPeriodUnits=Years
    RenewalValidityPeriod=5
    CRLPeriod=Weeks
    CRLPeriodUnits=1
    CRLDeltaPeriod=Days
    CRLDeltaPeriodUnits=1
    LoadDefaultTemplates=False
    AlternateSignatureAlgorithm=0
    [AuthorityInformationAccess]
    URL=http://pki.lab.local/Certenroll/IssuingCA01.crt
    [CRLDistributionPoint]
    URL=http://pki.lab.local/Certenroll/IssuingCA01.crl
    [basicconstraintsextension]
    pathlength = 0
    critical=true
    Thanks All
    AAnotherUser__

    > Is the above logic sound?
    not that much. In this case 3-tier PKI could be reduced to 2-tier. Make default Offline Root CA and below it issuing CAs with desired policy OIDs. You will combine issuing CA with policy CA functionality. Additional tier will cost you a license, administration
    overhead and increased certificate chain processing delays. There is nothing wrong if you combine policy CAs with issuing.
    > I saw a blog post which stated if are going to use certificate/issuance policies (other than all issuance policies) you should mark the extension as critical=true
    where did you get this? Certificate policies should not be marked critical. Certificate chaining engine will take care of it, when application reqests CCE to validate desired policy.
    > does setting the extension to critical also force the client to try and access the URL listed
    no. Certificate chaining engine do not inspect policy qualifier URLs.
    > Any comments suggestions on my proposed three CAPolicy.inf files below for the 3-tier PKI (again offline Root and Policy)
    [CRLDistributionPoint]
    [AuthorityInformationAccess]
    [PolicyStatementExtension]
    Policies = AllIssuancePolicy
    Critical = FALSE
    [AllIssuancePolicy]
    OID = 2.5.29.32.0
    these sections are not required in root CA.
    [AuthorityInformationAccess]
    URL=http://pki.lab.local/Certenroll/PolicyCA01.crt
    [CRLDistributionPoint]
    URL=http://pki.lab.local/Certenroll/PolicyCA01.crl
    [basicconstraintsextension]
    pathlength = 1
    critical=true
    These sections are not required at policy CA. Afaik, CDP and AIA extensions are not supported in non-root CA configuration files. The same is with issuing CA. And your issuing CA is missing PolicyStatementExtension section.
    Vadims Podāns, aka PowerShell CryptoGuy
    My weblog: en-us.sysadmins.lv
    PowerShell PKI Module: pspki.codeplex.com
    PowerShell Cmdlet Help Editor pscmdlethelpeditor.codeplex.com
    Check out new: SSL Certificate Verifier
    Check out new:
    PowerShell File Checksum Integrity Verifier tool.

  • HCM Processes & Forms - Some questions about the PD Processes

    Hi Experts,
    At my Organisation we use HCM Processes and Forms and Organisation Management and MSS to manage Position Based Security (PBS).
    The MSS Managers have requested a form be developed which they can use to extend an existing Position to Employee temporary assignment (IT1001 S-P with A081 relationship) which is due to expire within the next 30 days. We recently upgraded to ECC EHP6 and I thought I would now have a go at developing this Form.
    While researching in SCN and SAP Press books on the ‘HCM Processes and Forms’ topic, I have discovered a lot of information that has assisted me so far in progressing this solution.
    There are a few givens that I have confirmed so far, which are as follows;
    Since we are using Positions (Organisation Management), the only option available here is to use the PD Process, which implies using the SAP_PD Back_End Service. Therefore this become the baseline to build upon.
    While researching in SCN and SAP Press books on this subject I could not find relevant information about what is possible using the SAP_PD Service to achieve my solution design for the above requirements and thus my post to the HCM P&F Community for assistance.
    My questions are as follows;
    In the solution design, I was considering to use the “Process without Start Object” or “Mass Start” to skip Step 1 - “Selection Object” and use a Generic Service to get all the positions for the Manager (along the lines of the SAP Standard Generic Service - find Positions in Manager’s area of Responsibility) and only retain the Positions where the End Date for the IT1001 A081 relationship in between the Effective Date and Effective Date plus 30 days. This should provide me with all the positions under the Manager that have the A081 relationship with the assigned employee that are about to expire within the next 30 days.
    I want the result presented on the Form in a Table format so that the Manager has to enter the Extension Start Date and End Date for the new assignment period.
    Is this possible using Standard Design Time functionality?
    2.       Or Instead of Question 1, could I use OADP to achieve the same result using a custom search class to return a list of multiple objects (Positions)which is used to populate the form?
    3.       I get the impression that the ‘Mass Start’ process is mainly for multiple employees. Can it also be used for multiple PD objects?
    4.       I get the impression that if I used the ‘Mass Start’ option I could only use this if I was CREATING a new object or assignment? (I take it that you cannot use the Mass Start option to CHANGE multiple existing objects. Only because I have not seen any SAP Standard examples of this yet!)   Please confirm if this is possible?
    5.       Has anyone used the “Query for Mass Start” option on a Process? How does that work? (Could I write a ‘SAP Query’ to get the positions I am interested in under the Manager?) Is there a sample SAP Standard process that uses a query?
    Your assistance would be greatly appreciated.
    Thanks in Advance.
    Regards,
    Steve

    no limit
    no limit
    limitations of what?
    you can use forms on mac, pc, and other systems

  • One question about lcds2.5 link with java

    when i am creating a custom Message Service adapter,found a
    question with rewriting invoke() method.
    java class :
    package test;
    import flex.messaging.services.ServiceAdapter;
    import flex.messaging.services.MessageService;
    import flex.messaging.messages.Message;
    public class TestAdapter extends ServiceAdapter {
    public Object invoke(Message message) {
    MessageService msgService = (MessageService)service;
    msgService.pushMessageToClients(message, true);
    msgService.sendPushMessageFromPeer(message, true);
    return null;
    error:
    service can not resolved about MessageService msgService =
    (MessageService)service;
    please tell me a method :how to write this TestAdapter class.

    ths, i can success.
    but one error occur when i send message from java class to
    lcds2.5 service.
    i tranfer this IMessageUtil interface's setMessage method,set
    param as "test",but no value in mxml file's mx:Consumer .
    my message-config.xml is correct.
    message-config.xml:
    <adapter-definition id="fdschathandler" class="test"/>
    <destination id="fdschat">
    <properties>
    <network>
    <session-timeout>0</session-timeout>
    </network>
    <server>
    <max-cache-size>1000</max-cache-size>
    <message-time-to-live>0</message-time-to-live>
    <durable>false</durable>
    </server>
    </properties>
    <channels>
    <channel ref="my-rtmp"/>
    </channels>
    <adapter ref="fdschathandler"/>
    </destination>
    java class:
    package test;
    import flex.messaging.MessageBroker;
    import flex.messaging.MessageException;
    import flex.messaging.messages.AsyncMessage;
    import flex.messaging.messages.Message;
    import flex.messaging.services.MessageService;
    import flex.messaging.services.ServiceAdapter;
    public class MessageUtil extends ServiceAdapter implements
    IMessageUtil {
    public Object invoke(Message message) {
    try{
    MessageBroker broker = MessageBroker.getMessageBroker(null);
    MessageService msgService = (MessageService)
    broker.getService("message-service");
    msgService.pushMessageToClients(message, true);
    msgService.sendPushMessageFromPeer(message, true);
    return null;
    }catch(MessageException ff){
    System.out.println("fff:="+ff.getErrorMessage());
    catch(Exception e){
    e.printStackTrace();
    return message;
    public void setMessage(String mess) {
    try{
    AsyncMessage message=new AsyncMessage();
    message.setDestination("fdschat");
    message.setBody(mess);
    this.invoke(message);
    }catch(Exception e){
    e.printStackTrace();
    mxml:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="consumer.subscribe()">
    <mx:Script>
    <![CDATA[
    import mx.messaging.events.MessageEvent;
    import mx.messaging.messages.AsyncMessage;
    import mx.messaging.messages.IMessage;
    private function send():void
    var message:AsyncMessage = new AsyncMessage();
    message.body = msg.text;
    producer.send(message);
    msg.text = "";
    private function messageHandler(message:MessageEvent):void
    var msg:AsyncMessage = AsyncMessage( message.message );
    log.text += msg.body + "\n";
    ]]>
    </mx:Script>
    <mx:Producer id="producer" destination="fdschat"/>
    <mx:Consumer id="consumer" destination="fdschat"
    message="messageHandler(event)"/>
    <mx:Panel title="Chat" width="100%" height="100%">
    <mx:TextArea id="log" width="100%" height="100%"/>
    <mx:ControlBar>
    <mx:TextInput id="msg" width="100%" enter="send()"/>
    <mx:Button label="Send" click="send()"/>
    </mx:ControlBar>
    </mx:Panel>
    </mx:Application>

  • A simple question about the Integration process and the PI system

    Hi all
    Out PI system gets more and more slowly .
    in the Monitor I can se that there are many ufinished IP about 100.
    in the Outbound colon there is a Watch icon with the message
    QMessage being sent                     
    and in the graphic of the IP thers is a Send Message Asynchronously  with text in process.
    my question is can those unfineshed IP be guilty in slowing down the system by taking resources, they have been there for quit a long time .
    Thanks

    Hi again
    I have checked sm12 , no locks
    theres is no mapping involved in this step , the IP is trying to send a file to  server.
    I just want to know if  100 unfinished IP slow down the system .
    It does not matter if the file has been sent or not
    is there any way to check those IP if they are taking resources.
    Thanks.

  • Question about Original Batch for IS-Mill

    Dear guru.
    I must assign more than one original batch to a production order. Can i do this?
    Thanks.

    Hi,
    It is not possible to assign 2 batch numbers to a product coming out of a production order.
    I am still not very clear about your requirements.
    However, I come across requirements of using only one RM batch in a FG batch (not vice versa). This can be achieved. You need to do an enhancement which runs at the time of reservation/component batch determination/process order release. It reduces the quantity of FG as per available quantity of RM and may create a new proction order for remaining quantity.
    Thanks
    Ashutosh

Maybe you are looking for

  • Purchase Requisition Date is not updated with Scheduleline Delivery Date

    Hi,   This is a third part Sales Scenario. The Delivery date on the schedule line is passed on to purchase requisition as the delivery date of that item. Due to some business requirement, the delivery date of the schedule line is changed just before

  • Looking for a Photo App recommendation.

    I am looking for a site forum or where I can ask to see if this type of Photo Editing App exists? I need one that can paste one photo on top of another, or similar? More or less, a pic in a pic type. I have tried some collage apps yet they only place

  • Error message when launching Safari

    Hi everyone, I've never had this problem before yesterday and I'm not sure what happen. The only new thing I've done is update safari (like last week). When I try opening safari for windows I get an error message which makes no sense to me. I've trie

  • Cocoon2 weblogic (5.1 sp6) class loader security problem

    Hello folks, System: Cocoon: v2.0 JDK: Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C), Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode) OS: NT4 SP5 Servlet: v2.2 AppServer: Weblogic 5.1 SP6 Symptoms: I've updated our applicati

  • Documentation for oracle webcenter wiki and blog server 10.1.3.2.0

    Hi Can anyone tell me where I can get the documentation for oracle webcenter wiki and blog server 10.1.3.2.0. I am specifically interested in this version and not the latest version Oracle® WebCenter Wiki and Blog Server 10g Release 3 (10.1.3.4.0) be