Please help with small method error

This is straight from:
http://java.sun.com/developer/onlineTraining/new2java/divelog/part1/page7.jsp
Keeps saying ")" is expected....i can't figure it out...usually can figure this error out quick...not this time....
This does not work, and copy/pasting the code from the site does not work
private void buildMenu()
            JMenuBar jmb = new JMenuBar();
            JMenu menu = new JMenu("File"/**, yes*/);
            JMenuItem item = new JMenuItem("Exit");
                 item.addActionListener(new ActionListener()
                    public void actionPerformed(Action Event ae)
                        System.exit(0);
        }// I added this one hoping it'd fix it.......nope.
This works all by itself....
   private void buildMenu()
            JMenuBar jmb = new JMenuBar();
            JMenu menu = new JMenu("File"/**, yes*/);
            JMenuItem item = new JMenuItem("Exit");
The hypothesis is that this is the problem area:
   item.addActionListener(new ActionListener()
                    public void actionPerformed(Action Event ae)
                        System.exit(0);
                }); Thank you!

ahhhhhhhhhhhhhhhhh!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Thank you, lol!!
spending so much time looking at curly braces didn't go through the rest of the code.....i'm going to go bang my head against the wall.
omfg...

Similar Messages

  • Please help with this method

    im creating a little animation of pacman, just an animation of it moving buy its self. im using the java elements package so this is all being shown in a drawing window.
    ive made it move fine and go round the window abit eating dots but the code is a mess, and i know i could change some of the main part into a few simple methods and have tried but it seems to stop moving when i try
    below is part of the code, the first three blocks are when its moving sideways with its mouth in three different states, and the bottom three blocks are it moving down with its mouth in three states again.
    Arc pacarc = new Arc();
    while (startmv++<stopmv)
    pac1x += 4;
    d.setForeground(Color.yellow);
    pacarc = new Arc(pac1x,pac1y,pacsize1,pacsize2,pacmouth1,pacangle1);
    d.fill(pacarc);
    d.setForeground(Color.black);
    waitNSeconds(1);
    d.fill(pacarc);
    pac1x += 4;
    d.setForeground(Color.yellow);
    pacarc = new Arc(pac1x,pac1y,pacsize1,pacsize2,pacmouth2,pacangle2);
    d.fill(pacarc);
    d.setForeground(Color.black);
    waitNSeconds(1);
    d.fill(pacarc);
    pac1x += 4;
    d.setForeground(Color.yellow);
    pacarc = new Arc(pac1x,pac1y,pacsize1,pacsize2,pacmouth3,pacangle3);
    d.fill(pacarc);
    d.setForeground(Color.black);
    waitNSeconds(1);
    d.fill(pacarc);
    while (startdwn++<stopdwn)
    pac1y +=4;
    d.setForeground(Color.yellow);
    pacarc = new Arc(pac1x,pac1y,50,50,pacdwn1,pacdwnang1);
    d.fill(pacarc);
    d.setForeground(Color.black);
    waitNSeconds(1);
    d.fill(pacarc);
    pac1y +=4;
    d.setForeground(Color.yellow);
    pacarc = new Arc(pac1x,pac1y,50,50,pacdwn2,pacdwnang2);
    d.fill(pacarc);
    d.setForeground(Color.black);
    waitNSeconds(1);
    d.fill(pacarc);
    pac1y +=4;
    d.setForeground(Color.yellow);
    pacarc = new Arc(pac1x,pac1y,50,50,pacdwn3,pacdwnang3);
    d.fill(pacarc);
    d.setForeground(Color.black);
    waitNSeconds(1);
    d.fill(pacarc);
    so for the first part i tried putting this into a method and running the program but where i had used the method the pacman shape just stayed still. any help please guys?
    this is the code for the method i tried (this is just for thefirst state of the pacmans mouth while moving sideways)
    public static void pacmve(int pactestx, int pactesty, int pacsizetest1, int pacsizetest2, int pacmouthtest, int pacangletest)
    pactestx += 4;
    Arc pacarc = new Arc();
    d.setForeground(Color.yellow);
    pacarc = new Arc(pactestx,pactesty,pacsizetest1,pacsizetest2,pacmouthtest,pacangletest);
    d.fill(pacarc);
    d.setForeground(Color.black);
    waitNSeconds(1);
    d.fill(pacarc);
    this is the loop i where i was trying to use the method
    while (startmv++<stopmv)
    pacmve(20,20,50,50,45,270);
    Edited by: jeffsimmo85 on Nov 22, 2007 1:18 AM

    When you post a code on a public forum, the code must be:
    1)Properly formatted using code tags.
    2)Generally compilable and runnable for us casual forum viewers.
    3)Reproducible of your problems when we run it.

  • Please help with this method, cant get it to work correctly.

    any suggestions AT ALL please, im really stuck with this.
    im creating a little animation of pacman, just an animation of it moving buy its self. im using the java elements package so this is all being shown in a drawing window.
    ive made it move fine and go round the window abit eating dots but the code is a mess, and i know i could change some of the main part into a few simple methods and have tried but it seems to stop moving when i try
    import element.*;
    import java.awt.Color;
    static DrawingWindow d = new DrawingWindow(500,500);  
       public static void wait1second()
        //  pause for one tenth of a second second
            long now = System.currentTimeMillis();
            long then = now + 100; // 100 milliseconds
            while (System.currentTimeMillis() < then)
        public static void waitNSeconds(int number)
            int i;
            for (i = 0; i < number; i++) //allows you to determine how long to pause for
                wait1second();
    public static void main(String[] args) {
        //  declaring the variables
        int pacsize1 = 50, pacsize2 = 50;
        int pac1x = 20, pac1y = 20;
        int pacmouth1 = 45, pacangle1 = 270;
        int pacmouth2 = 25, pacangle2 = 320;
        int pacmouth3 = 6, pacangle3 = 348;
        int startmv = 0, stopmv = 33;
        d.setForeground(Color.black);
        Rect bkrnd = new Rect(0,0,500,500);     
        d.fill(bkrnd);
       // while loop used to make the pacman shape move right across the screen with its mouth in three different states
    Arc pacarc = new Arc();
         while (startmv++<stopmv)
            pac1x += 4;
            d.setForeground(Color.yellow);
            pacarc = new Arc(pac1x,pac1y,pacsize1,pacsize2,pacmouth1,pacangle1);
            d.fill(pacarc);
            d.setForeground(Color.black);
            waitNSeconds(1);
            d.fill(pacarc);
            pac1x += 4;
            d.setForeground(Color.yellow);
            pacarc = new Arc(pac1x,pac1y,pacsize1,pacsize2,pacmouth2,pacangle2);
            d.fill(pacarc);
            d.setForeground(Color.black);
            waitNSeconds(1);
            d.fill(pacarc);
            pac1x += 4;
            d.setForeground(Color.yellow);
            pacarc = new Arc(pac1x,pac1y,pacsize1,pacsize2,pacmouth3,pacangle3);
            d.fill(pacarc);
            d.setForeground(Color.black);
            waitNSeconds(1);
            d.fill(pacarc);
    }so i tried making a method to make all the stuf in the while loop alot simpler but it just keeps making the pacman not move at all and im not sure why. heres the code i tried for the method:
    public static void pacmve(int pactestx, int pactesty, int pacsizetest1, int pacsizetest2, int pacmouthtest, int pacangletest)
            pactestx += 4;
            Arc pacarc = new Arc();
            d.setForeground(Color.yellow);
            pacarc = new Arc(pactestx,pactesty,pacsizetest1,pacsizetest2,pacmouthtest,pacangletest);
            d.fill(pacarc);
            d.setForeground(Color.black);
            waitNSeconds(1);
            d.fill(pacarc);
            }it had no problems with the code, but it just doesnt seem to do anything when i call it in the while loop. heres how i used it to try and just make it move across with the mouth in one state:
    while (startmv++<stopmv)
    pacmve(20,20,50,50,45,270);
    }any ideas?
    Edited by: jeffsimmo85 on Nov 22, 2007 2:36 AM

    the clock is still ticking while you do this:
    while (System.currentTimeMillis() < then)
    is that method your design? why not just call Thread.sleep()?
    %

  • Please help with iTunes download error -50

    I have been never been able to download from iTunes and always get the unable to dowload error -50 message. I have seen people have this same question before on here and were able to fix it by adjusting their firewall settings, etc. I am not sure how to do that. I have Norton Internet Security and thought that may be conflicting with it as well. My computer is Windows XP SP2. Can anyone help me fix this? Any specific instructions would be helpful and much appreciated! Thanks!

    Perhaps try the "Error -50," "-5000," "8003," "8008," or "-42023" section in the Specific Conditions and Alert Messages: (Mac OS X / Windows) section of the following document:
    iTunes: Advanced iTunes Store troubleshooting

  • Please help with this weird error!

    I am using the normal template with based on Existing Tables. When I try to edit the rows with the edit icon not all fields in the table are filled. If I had Version number 1.1.1, it is shown as blank in the edit screen but the number still displays in the main table. And when i try to edit the row nothing changes after i edited it "successfully". Any suggestions? thanks

    ORA-20001: Error in DML: p_rowid=TESTingS, p_alt_rowid=SID, p_rowid2=TESTingS, p_alt_rowid2=SERVER. ORA-01403: no data found
    The above is the complete error. I create rows fine but when I edit them i get this error. Also some fields are empty when there is definitely data init from the table view. please help

  • Please help with small but annoying 'Open With' finder problem

    hello, when I CTRL click a file in finder and select 'Open With' a huge list of apps appear and the same app apperars multiple times. e.g toast appears about 7 times Please have a look at the image below as a picture can say a 1000 words.
    [img]http://xs62.xs.to/pics/06016/toomanyapps.jpg.xs.jpg[/img]
    iMac G4 1.25ghz 20   Mac OS X (10.4.2)  

    You should be able to fix that by rebuilding the LaunchServices database.
    I use OnyX (Maintenance tab, Reset section).
    http://www.macupdate.com/info.php/id/11582

  • Please Help with iTunes Download- Error 1606

    OKay, so you had me try to download itunes and I did try. When it did start to download it was checking for something on my computer and gave me this error- Error1606: Could not access network location bin. Then when I closed the download is said Error: -1603 fatal error during installation. I'm sure the second one was because I closed it, but I'm not sure about the first one. Thanks for your help, it's appriciated.
    Thanks-
    Apple Customer- Katrina

    Just deleted all other (ANyDVD, Decoder and shrink) programs, uninstalled Itunes and Quicktime; reinstalled Itunes 7.3 and Quicktime 7. Thanks for all the help. Randy

  • Please help with this ProC error

    Here's what I'm getting:
    [oracle@dodona proc]$ make -f demo_proc.mk sample1
    make -f /oradb01/app/oracle/product/8.1.6/precomp/demo/proc/demo_proc.mk OBJS=sample1.o EXE=sample1 build
    make[1]: Entering directory `/usr/local/oracle816/app/oracle/product/8.1.6/precomp/demo/proc'
    proc iname=sample1
    proc: error in loading shared libraries: libclntsh.so.8.0: cannot read file data: No such file or directory
    make[1]: *** [sample1.o] Error 127
    make[1]: Leaving directory `/usr/local/oracle816/app/oracle/product/8.1.6/precomp/demo/proc'
    make: *** [sample1] Error 2
    My LD_LIBRARY_PATH is set. LIBHOME used in the demo makefile is set in $ORACLE_HOME/precomp/lib/env_precomp.mk as $(ORACLE_HOME)/lib/.

    You should find a symbolic link in your $ORACLE_HOME/lib directory:
    libclntsh.so -> libclntsh.so.8.0
    If the file or the link doesn't exist for some reason (maybe an installation problem), you can run $ORACLE_HOME/bin/genclntsh to recreate them.
    I also still had problems getting the makefile to find this file, so I modified the $ORACLE_HOME/lib/sysliblist file and added -lclntsh to the end, which works fine for me now.
    Hope this helps... Frank

  • Please help with a server error

    Server Error in '/' Application.
    Runtime Error
    Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
    Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
    <!-- Web.Config Configuration File -->  <configuration> <system.web> <customErrors mode="Off"/> </system.web> </configuration>
    Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
    <!-- Web.Config Configuration File -->  <configuration> <system.web> <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/> </system.web> </configuration>

    Hello,
    So, tell us more... what services are you sharing, is this a NetBoot? Admin account? What App is reporting this?
    Open Console in Utilities & see if there are any clues or repeating messages when this happens.

  • Please help with FRM-40508 error

    Hello everyone.
    I designed a form. I get a frm-40508 error.
    Tables for this form are valid and exist.
    I have no idea what else could cause this error.
    Any suggestions are welcome.
    Thanks in advance,
    Sonya

    Hi
    Is the table you are trying to insert into in the same Schema as the user you are compiling and running the form as?
    eg. If you created the table as USER 'SCOTT', are you compiling and running the form as 'SCOTT'?
    If the schema is the same for the table creation and the compilation/running of your form then I'm a bit stuck.
    If, however, they are different then what you will need to do is grant a public synonym for your table and then grant Select, Insert, Update, Delete privelliges (as appropriate) to the user/role accessing the table/running the form.
    HTH.
    Simon

  • Please help with CMR - strange error.

    Hi,
    im using xdoclet to generate sun files and i also tried to configure CMR manually in
    the ejb-jar.xml but i just cant get it working:
    When i try to deploy my app i always get the following strange exception:
    [#|2004-12-11T20:50:48.281+0100|SCHWERWIEGEND|sun-appserver-pe8.1|javax.enterpr ise.system.tools.deployment|_ThreadID=13;|Caught java.lang.NullPointerException while processing CMP beans for application [informatrix]; module [informatrix.jar]: null. See log for details.
    java.lang.NullPointerException
    at com.sun.jdo.spi.persistence.support.ejb.ejbc.EjbConversionHelper.getRealRelatio nRoleDescriptor(EjbConversionHelper.java:363)
    at com.sun.jdo.spi.persistence.support.ejb.ejbc.EjbConversionHelper.getRelationRol eDescriptor(EjbConversionHelper.java:357)
    at com.sun.jdo.spi.persistence.support.ejb.ejbc.EjbConversionHelper.getInverseFiel dName(EjbConversionHelper.java:227)
    at com.sun.jdo.api.persistence.mapping.ejb.MappingFile.completeCmrMappings(Mapping File.java:1636)
    at com.sun.jdo.api.persistence.mapping.ejb.MappingFile.intoMappingClasses(MappingF ile.java:131)
    at com.sun.jdo.spi.persistence.support.ejb.ejbc.MappingGenerator.loadMappingClasse s(MappingGenerator.java:460)
    at com.sun.jdo.spi.persistence.support.ejb.ejbc.MappingGenerator.generateMapping(M appingGenerator.java:274)
    at com.sun.jdo.spi.persistence.support.ejb.ejbc.JDOCodeGenerator.loadOrCreateMappi ngClasses(JDOCodeGenerator.java:581)
    at com.sun.jdo.spi.persistence.support.ejb.ejbc.JDOCodeGenerator.init(JDOCodeGener ator.java:153)
    at com.sun.jdo.spi.persistence.support.ejb.ejbc.JDOCodeGenerator.init(JDOCodeGener ator.java:126)
    at com.sun.ejb.codegen.CmpCompiler.compile(CmpCompiler.java:143)
    at com.sun.ejb.codegen.IASEJBC.doCompile(IASEJBC.java:615)
    at com.sun.ejb.codegen.IASEJBC.ejbc(IASEJBC.java:563)
    at com.sun.enterprise.deployment.backend.EJBCompiler.preDeployApp(EJBCompiler.java :361)
    at com.sun.enterprise.deployment.backend.EJBCompiler.compile(EJBCompiler.java:209)
    at com.sun.enterprise.deployment.backend.AppDeployer.runEJBC(AppDeployer.java:286)
    at com.sun.enterprise.deployment.backend.AppDeployer.deploy(AppDeployer.java:176)
    at com.sun.enterprise.deployment.backend.AppDeployer.doRequestFinish(AppDeployer.j ava:107)
    at com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:138)
    at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPh ase.java:71)
    at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeplo ymentService.java:626)
    at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentSe rvice.java:187)
    at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentSe rvice.java:513)
    at com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:140)
    at com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:168)
    |#]
    Can anyone explain what do those fields:
    name
    role-name
    cascade-delete
    target-ejb
    target-role-name
    target-cascade-delete
    target-multiple
    mean.
    My scenario is following:
    Bean 1 = User
    Bean 2 = EmployeeData
    Relationship: User has EmployeeData (1:1)
    Tables:
    Bean 1 mapped to users
    Bean 2 mapped to employee_data
    Collumns:
    Bean 1 references Bean 2 in column pk_login Bean 1-field is login
    Bean 2 references Bean 1 in column fk_login Bean 2-field is login
    Thanx a lot to anyone who answers.

    For the 1:1 relationship, the ejb.xml needs to have the relationship defined
    <ejb-relation>
    <ejb-relationship-role>
    <ejb-relationship-role-name>AEJB-BEJB</ejb-relationship-role-name>
    <multiplicity>One</multiplicity>
    <relationship-role-source>
    <ejb-name>AEJB</ejb-name>
    </relationship-role-source>
    <cmr-field>
    <cmr-field-name>b</cmr-field-name>
    </cmr-field>
    </ejb-relationship-role>
    <ejb-relationship-role>
    <ejb-relationship-role-name>BEJB-AEJB</ejb-relationship-role-name>
    <multiplicity>One</multiplicity>
    <relationship-role-source>
    <ejb-name>BEJB</ejb-name>
    </relationship-role-source>
    <cmr-field>
    <cmr-field-name>a</cmr-field-name>
    </cmr-field>
    </ejb-relationship-role>
    For sun-cmp-mappings. xml make sure the column name for the FK of the related bean is defined
    <entity-mapping>
    <ejb-name>AEJB</ejb-name>
    <table-name>AEJB_1X1_BI_BTOB</table-name>
    <cmp-field-mapping>
    <field-name>id</field-name>
    <column-name>ID</column-name>
    </cmp-field-mapping>
    <cmp-field-mapping>
    <field-name>name</field-name>
    <column-name>NAME</column-name>
    </cmp-field-mapping>
    <cmp-field-mapping>
    <field-name>value</field-name>
    <column-name>VALUE</column-name>
    </cmp-field-mapping>
    <cmr-field-mapping>
    <cmr-field-name>b</cmr-field-name>
    <column-pair>
    <column-name>ID</column-name>
    <column-name>BEJB_1X1_BI_BTOB.FK_FOR_AEJB_1X1_BI_BTOB</column-name>
    </column-pair>
    </cmr-field-mapping>
    </entity-mapping>
    <entity-mapping>
    <ejb-name>BEJB</ejb-name>
    <table-name>BEJB_1X1_BI_BTOB</table-name>
    <cmp-field-mapping>
    <field-name>id</field-name>
    <column-name>ID</column-name>
    </cmp-field-mapping>
    <cmp-field-mapping>
    <field-name>name</field-name>
    <column-name>NAME</column-name>
    </cmp-field-mapping>
    <cmp-field-mapping>
    <field-name>value</field-name>
    <column-name>VALUE</column-name>
    </cmp-field-mapping>
    <cmr-field-mapping>
    <cmr-field-name>a</cmr-field-name>
    <column-pair>
    <column-name>FK_FOR_AEJB_1X1_BI_BTOB</column-name>
    <column-name>AEJB_1X1_BI_BTOB.ID</column-name>
    </column-pair>
    </cmr-field-mapping>

  • HT201210 cont contact apple server error please help with ipad touch 4. im just fed up with apple please help me because why is it only apple with these kind of problems?

    cont contact apple server error please help with ipad touch 4. im just fed up with apple please help me because why is it only apple with these kind of problems?

    If you mean updae server
    Update Server
    Try:
    - Powering off and then back on your router.
    - iTunes for Windows: iTunes cannot contact the iPhone, iPad, or iPod software update server
    - Change the DNS to either Google's or Open DNS servers
    Public DNS — Google Developers
    OpenDNS IP Addresses
    - For one user uninstalling/reinstalling iTunes resolved the problem
    - Try on another computer/network
    - Wait if it is an Apple problem
    Otherwise what server are you talking about

  • Please, could you help with The System Error?

    Hi guys,
    Please could someone help me with The system error: The Parameter is incorrect? which appears on the screen when I open Adobe Photoshop?
    It is Starter edition3.0 and so far it worked ok and suddenly this message haunts my screen. If I clic OK, whole application disappears. I tried hundred times and checked it is 5.1.2600 and my notebook has got Windows XP Profesional.
    Any advice hunging around?
    ThaaankxJ

    Thank you mark, I'll try.
    J
    Date: Fri, 18 Mar 2011 17:17:20 -0600
    From: [email protected]
    To: [email protected]
    Subject: Please, could you help with The System Error?
    Hi orion,
    Sorry that was the impression made by the support agent. If the version of the software that you have is 3.0 or 3.2, then the catalog can be upgraded when you run the trial version of Photoshop Elements. Version 8 had no time limitations, not sure if version 9 will timeout after 30 days or not.
    Just install, and when you launch, Elements will automatically convert the catalog to a format that it can read.
    -Mark
    >

  • Please help with an embedded query (INSERT RETURNING BULK COLLECT INTO)

    I am trying to write a query inside the C# code where I would insert values into a table in bulk using bind variables. But I also I would like to receive a bulk collection of generated sequence number IDs for the REQUEST_ID. I am trying to use RETURNING REQUEST_ID BULK COLLECT INTO :REQUEST_IDs clause where :REQUEST_IDs is another bind variable
    Here is a full query that use in the C# code
    string sql = "INSERT INTO REQUESTS_TBL(REQUEST_ID, CID, PROVIDER_ID, PROVIDER_NAME, REQUEST_TYPE_ID, REQUEST_METHOD_ID, " +
    "SERVICE_START_DT, SERVICE_END_DT, SERVICE_LOCATION_CITY, SERVICE_LOCATION_STATE, " +
    "BENEFICIARY_FIRST_NAME, BENEFICIARY_LAST_NAME, BENEFICIARY_DOB, HICNUM, CCN, " +
    "CLAIM_RECEIPT_DT, ADMISSION_DT, BILL_TYPE, LANGUAGE_ID, CONTRACTOR_ID, PRIORITY_ID, " +
    "UNIVERSE_DT, REQUEST_DT, BENEFICIARY_M_INITIAL, ATTENDING_PROVIDER_NUMBER, " +
    "BILLING_NPI, BENE_ZIP_CODE, DRG, FINAL_ALLOWED_AMT, STUDY_ID, REFERRING_NPI) " +
    "VALUES " +
    "(SQ_CDCDATA.NEXTVAL, :CIDs, :PROVIDER_IDs, :PROVIDER_NAMEs, :REQUEST_TYPE_IDs, :REQUEST_METHOD_IDs, " +
    ":SERVICE_START_DTs, :SERVICE_END_DTs, :SERVICE_LOCATION_CITYs, :SERVICE_LOCATION_STATEs, " +
    ":BENEFICIARY_FIRST_NAMEs, :BENEFICIARY_LAST_NAMEs, :BENEFICIARY_DOBs, :HICNUMs, :CCNs, " +
    ":CLAIM_RECEIPT_DTs, :ADMISSION_DTs, :BILL_TYPEs, :LANGUAGE_IDs, :CONTRACTOR_IDs, :PRIORITY_IDs, " +
    ":UNIVERSE_DTs, :REQUEST_DTs, :BENEFICIARY_M_INITIALs, :ATTENDING_PROVIDER_NUMBERs, " +
    ":BILLING_NPIs, :BENE_ZIP_CODEs, :DRGs, :FINAL_ALLOWED_AMTs, :STUDY_IDs, :REFERRING_NPIs) " +
    " RETURNING REQUEST_ID BULK COLLECT INTO :REQUEST_IDs";
    int[] REQUEST_IDs = new int[range];
    cmd.Parameters.Add(":REQUEST_IDs", OracleDbType.Int32, REQUEST_IDs, System.Data.ParameterDirection.Output);
    However, when I run this query, it gives me a strange error ORA-00925: missing INTO keyword. I am not sure what that error means since I am not missing any INTOs
    Please help me resolve this error or I would appreciate a different solution
    Thank you

    It seems you are not doing a bulk insert but rather an array bind.
    (Which you will also find that it is problematic to do an INSERT with a bulk collect returning clause (while this works just fine for update/deletes) :
    http://www.oracle-developer.net/display.php?id=413)
    But you are using array bind, so you simply just need to use a
    ... Returning REQUEST_ID INTO :REQUEST_IDand that'll return you a Rquest_ID[]
    see below for a working example (I used a procedure but the result is the same)
    //Create Table Zzztab(Deptno Number, Deptname Varchar2(50) , Loc Varchar2(50) , State Varchar2(2) , Idno Number(10)) ;
    //create sequence zzzseq ;
    //CREATE OR REPLACE PROCEDURE ZZZ( P_DEPTNO   IN ZZZTAB.DEPTNO%TYPE,
    //                      P_DEPTNAME IN ZZZTAB.DEPTNAME%TYPE,
    //                      P_LOC      IN ZZZTAB.LOC%TYPE,
    //                      P_State    In Zzztab.State%Type ,
    //                      p_idno     out zzztab.idno%type
    //         IS
    //Begin
    //      Insert Into Zzztab (Deptno,   Deptname,   Loc,   State , Idno)
    //                  Values (P_Deptno, P_Deptname, P_Loc, P_State, Zzzseq.Nextval)
    //                  returning idno into p_idno;
    //END ZZZ;
    //Drop Procedure Zzz ;
    //Drop Sequence Zzzseq ;
    //drop Table Zzztab;
      class ArrayBind
        static void Main(string[] args)
          // Connect
            string connectStr = GetConnectionString();
          // Setup the Tables for sample
          Setup(connectStr);
          // Initialize array of data
          int[]    myArrayDeptNo   = new int[3]{1, 2, 3};
          String[] myArrayDeptName = {"Dev", "QA", "Facility"};
          String[] myArrayDeptLoc  = {"New York", "Chicago", "Texas"};
          String[] state = {"NY","IL","TX"} ;
          OracleConnection connection = new OracleConnection(connectStr);
          OracleCommand    command    = new OracleCommand (
            "zzz", connection);
          command.CommandType = CommandType.StoredProcedure;
          // Set the Array Size to 3. This applied to all the parameter in
          // associated with this command
          command.ArrayBindCount = 3;
          command.BindByName = true;
          // deptno parameter
          OracleParameter deptNoParam = new OracleParameter("p_deptno",OracleDbType.Int32);
          deptNoParam.Direction       = ParameterDirection.Input;
          deptNoParam.Value           = myArrayDeptNo;
          command.Parameters.Add(deptNoParam);
          // deptname parameter
          OracleParameter deptNameParam = new OracleParameter("p_deptname", OracleDbType.Varchar2);
          deptNameParam.Direction       = ParameterDirection.Input;
          deptNameParam.Value           = myArrayDeptName;
          command.Parameters.Add(deptNameParam);
          // loc parameter
          OracleParameter deptLocParam = new OracleParameter("p_loc", OracleDbType.Varchar2);
          deptLocParam.Direction       = ParameterDirection.Input;
          deptLocParam.Value           = myArrayDeptLoc;
          command.Parameters.Add(deptLocParam);
          //P_STATE -- -ARRAY
          OracleParameter stateParam = new OracleParameter("P_STATE", OracleDbType.Varchar2);
          stateParam.Direction = ParameterDirection.Input;
          stateParam.Value = state;
          command.Parameters.Add(stateParam);
                  //idParam-- ARRAY
          OracleParameter idParam = new OracleParameter("p_idno", OracleDbType.Int64 );
          idParam.Direction = ParameterDirection.Output ;
          idParam.OracleDbTypeEx = OracleDbType.Int64;
          command.Parameters.Add(idParam);
          try
            connection.Open();
            command.ExecuteNonQuery ();
            Console.WriteLine("{0} Rows Inserted", command.ArrayBindCount);
              //now cycle through the output param array
            foreach (Int64 i in (Int64[])idParam.Value)
                Console.WriteLine(i);
          catch (Exception e)
            Console.WriteLine("Execution Failed:" + e.Message);
          finally
            // connection, command used server side resource, dispose them
            // asap to conserve resource
            connection.Close();
            command.Dispose();
            connection.Dispose();
          Console.WriteLine("Press Enter to finish");
          Console.ReadKey();
        }

  • I need help with this code error "unreachable statement"

    the error_
    F:\Java\Projects\Tools.java:51: unreachable statement <-----------------------------------------------------------------------------------------------------------------THIS
    int index;
    ^
    F:\Java\Projects\Tools.java:71: missing return statement
    }//end delete method
    ^
    F:\Java\Projects\Tools.java:86: missing return statement
    }//end getrecod
    ^
    3 errors
    import java.util.*;
    import javax.swing.*;
    import java.awt.*;
    public class Tools//tool class
    private int numberOfToolItems;
    private ToolItems[] toolArray = new ToolItems[10];
    public Tools()//array of tool
    numberOfToolItems = 0;
    for(int i = 0; i < toolArray.length; i++)//for loop to create the array tools
    toolArray[i] = new ToolItems();
    }//end for loop
    }//end of array of tools
    public int search(int id)//search mehtod
    int index = 0;
    while (index < numberOfToolItems)//while and if loop search
    if(toolArray[index].getID() == id)
    return index;
    else
    index ++;
    }//en while and if loop
    return -1;
    }//end search method
    public int insert(int id, int numberInStock, int quality, double basePrice, String nm)//insert method
    if(numberOfToolItems >= toolArray.length)
    return 0;
    int index;
    index = search(id); <-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------HERE
    if (index == -1)
    toolArray[index].assign(id,numberInStock, quality, basePrice,nm);
    numberInStock ++;
    return 1;
    }//end if index
    }//end if toolitem array
    return -1;
    }//end insert method
    public int delete(/*int id*/)//delete method
    }//end delete method
    public void display()//display method
    for(int i = 0; i < numberOfToolItems; i++)
    //toolArray.display(g,y,x);
    }//end display method
    public String getRecord(int i)//get record method
    // return toolArray[i].getName()+ "ID: "+toolArray[i].getID()
    }//end getrecod
    }//end class
    Edited by: ladsoftware on Oct 9, 2009 6:08 AM
    Edited by: ladsoftware on Oct 9, 2009 6:09 AM
    Edited by: ladsoftware on Oct 9, 2009 6:10 AM
    Edited by: ladsoftware on Oct 9, 2009 6:11 AM

    ladsoftware wrote:
    Subject: Re: I need help with this code error "unreachable statement"
    F:\Java\Projects\Tools.java:51: unreachable statement <-----------------------------------------------------------------------------------------------------------------THIS
    int index;
    ^
    F:\Java\Projects\Tools.java:71: missing return statement
    }//end delete method
    ^
    F:\Java\Projects\Tools.java:86: missing return statement
    }//end getrecod
    ^
    3 errorsThe compiler is telling you exactly what the problems are:
    public int insert(int id, int numberInStock, int quality, double basePrice, String nm)//insert method
    if(numberOfToolItems >= toolArray.length)
    return 0; // <<== HERE you return, so everyting in the if block after this is unreachable
    int index;
    index = search(id);  //< -----------------------------------------------------------------------------------------------------------------HERE
    if (index == -1)
    toolArray[index].assign(id,numberInStock, quality, basePrice,nm);
    numberInStock ++;
    return 1;
    }//end if index
    }//end if toolitem array
    return -1;
    }//end insert method
    public int delete(/*int id*/)//delete method
    // <<== HERE where is the return statement?
    }//end delete method
    public String getRecord(int i)//get record method
    // return toolArray.getName()+ "ID: "+toolArray[i].getID() <<== HERE you commented out the return statement
    }//end getrecod
    }//end class

Maybe you are looking for

  • A little help with rutorrent

    Hi comrades, I use rtorrent in terminal without problems but recently I got interested in rutorrent. I've been following the rtorrent wiki and rutorrent wiki to get to this point. First of all rtorrent is working fine in terminal, but with rutorrent

  • IWeb widget for idisk or HTML Code

    I've created an iFrame page for my website that links to my iDisk public folder using the HTML Snippet. I've password protected my public folder so is there anyway to include authentication in the HTML snippet so that the iframe page automatically lo

  • 10.6.5 and Magic Trackpad = FAIL

    I thought I had worked out the problems with my Magic Trackpad and 10.6.5, but right now it looks as though 10.6.5 broke my Magic Trackpad's functionality. After the 10.6.5 update, my Magic Trackpad is no longer recognized. I've reinstalled the Magic

  • "Conversations" sometimes shows own name, not name of callee

    We are using Lync 2013 with the latest updates on servers and clients. Multiple users noticed that under "Conversations", some entries show their own name instead of the caller/callee name. So, I called a colleague named, say, Susan. Under "Conversat

  • Help!  iSight Not Working with iMovie!

    I can't seem to use my iSight camera with iMovie. ?? The camera works with PhotoBooth, but with iMovie not even the "Record with iSight" button appears. I'm using iMovie 5 on an IMac G5 with a built-in iSight camera. Any suggestions on getting iSight