Boolean Array-- Help Plz Urgent

Can i create and initialize an array of booleans like this ?
Boolean[51] Position = true;
Thanks... Plz help

This works:Boolean[] bools = {
    new Boolean(true), new Boolean(true), new Boolean(true), new Boolean(true),
    new Boolean(true), new Boolean(true), new Boolean(true), new Boolean(true),
    new Boolean(true), new Boolean(true), new Boolean(true), new Boolean(true),
    new Boolean(true), new Boolean(true), new Boolean(true), new Boolean(true),
    new Boolean(true), new Boolean(true), new Boolean(true), new Boolean(true),
    new Boolean(true), new Boolean(true), new Boolean(true), new Boolean(true),
    new Boolean(true), new Boolean(true), new Boolean(true), new Boolean(true),
    new Boolean(true), new Boolean(true), new Boolean(true), new Boolean(true),
    new Boolean(true), new Boolean(true), new Boolean(true), new Boolean(true),
    new Boolean(true), new Boolean(true), new Boolean(true), new Boolean(true),
    new Boolean(true), new Boolean(true), new Boolean(true), new Boolean(true),
    new Boolean(true), new Boolean(true), new Boolean(true), new Boolean(true),
    new Boolean(true), new Boolean(true), new Boolean(true)
};... and, fortunately, so does this:Boolean[] bools = new Boolean[51];
java.util.Arrays.fill(bools, new Boolean(true));I hope you find this of some help.

Similar Messages

  • Unable to get Rmi program working. Help plz - urgent.

    Any help to get this problem resolved would be of help.
    I get the error as below:
    D:\test\nt>java Client
    Server
    Client exception: Error marshaling transport header; nested exception is:
    javax.net.ssl.SSLException: untrusted server cert chain
    java.rmi.MarshalException: Error marshaling transport header; nested exception is:
    javax.net.ssl.SSLException: untrusted server cert chain
    javax.net.ssl.SSLException: untrusted server cert chain
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a([DashoPro-V1.2-120198])
    at com.sun.net.ssl.internal.ssl.ClientHandshaker.a([DashoPro-V1.2-120198])
    at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage([DashoPro-V1.2-120198])
    at com.sun.net.ssl.internal.ssl.Handshaker.process_record([DashoPro-V1.2-120198])
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a([DashoPro-V1.2-120198])
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a([DashoPro-V1.2-120198])
    at com.sun.net.ssl.internal.ssl.AppOutputStream.write([DashoPro-V1.2-120198])
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:76)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:134)
    at java.io.DataOutputStream.flush(DataOutputStream.java:108)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:207)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:178)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:87)
    at Server_Stub.passArgs(Unknown Source)
    at Client.main(Client.java, Compiled Code)
    the server was invokde as:
    D:\test\nt>java -Djava.rmi.server.codebase="file:/d:/test" -Djava.policy=d:/test/policy Server a b c
    Server bound in registry
    where policy had allpermission
    The server program is given as below:
    import java.net.InetAddress;
    import java.rmi.Naming;
    import java.rmi.registry.LocateRegistry;
    import java.rmi.registry.Registry;
    import java.rmi.RemoteException;
    import java.rmi.RMISecurityManager;
    import java.rmi.server.UnicastRemoteObject;
    public class Server extends UnicastRemoteObject implements Message
         private static String[] args;
         public Server() throws RemoteException
              // super();     
              super(0, new RMISSLClientSocketFactory(),
                   new RMISSLServerSocketFactory());
         public String[] passArgs() {
              System.out.println(args[0]);
              System.out.println(args[1]);
              System.out.println(args[2]);
              System.out.println(args.length);
              System.out.println();
              return args;
         public static void main(String a[])
              // Create and install a security manager
              if (System.getSecurityManager() == null)
                   System.setSecurityManager(new RMISecurityManager());
              args=a;
              try
                   Server obj = new Server();
                   // Bind this object instance to the name "Server"
                   Registry r = LocateRegistry.createRegistry(4646);
                   r.rebind("Server", obj);
                   System.out.println("Server bound in registry");
              } catch (Exception e) {
                   System.out.println("Server err: " + e.getMessage());
                   e.printStackTrace();
    The RMISSLServerSocketFactory class is as below:
    import java.io.*;
    import java.net.*;
    import java.rmi.server.*;
    import javax.net.ssl.*;
    import java.security.KeyStore;
    import javax.net.*;
    import javax.net.ssl.*;
    import javax.security.cert.X509Certificate;
    import com.sun.net.ssl.*;
    public class RMISSLServerSocketFactory implements RMIServerSocketFactory, Serializable
         public ServerSocket createServerSocket(int port)
              throws IOException     
              SSLServerSocketFactory ssf = null;
              try {
                   // set up key manager to do server authentication
                   SSLContext ctx;
                   KeyManagerFactory kmf;
                   KeyStore ks;
                   char[] passphrase = "passphrase".toCharArray();
                   ctx = SSLContext.getInstance("TLS");
                   kmf = KeyManagerFactory.getInstance("SunX509");
                   ks = KeyStore.getInstance("JKS");
                   ks.load(new FileInputStream("testkeys"), passphrase);
                   kmf.init(ks, passphrase);
                   ctx.init(kmf.getKeyManagers(), null, null);
                   ssf = ctx.getServerSocketFactory();
              } catch (Exception e)
                   e.printStackTrace();
                   return ssf.createServerSocket(port);
    The RMIClientSocketFactory is as below:
    import java.io.*;
    import java.net.*;
    import java.rmi.server.*;
    import javax.net.ssl.*;
    public class RMISSLClientSocketFactory     implements RMIClientSocketFactory, Serializable
         public Socket createSocket(String host, int port)
              throws IOException
              SSLSocketFactory factory =(SSLSocketFactory)SSLSocketFactory.getDefault();
              SSLSocket socket = (SSLSocket)factory.createSocket(host, port);
                   return socket;
    And finally the client program is :
    import java.net.InetAddress;
    import java.rmi.registry.LocateRegistry;
    import java.rmi.registry.Registry;
    import java.rmi.RemoteException;
    public class Client
         public static void main(String args[])
              try
                   // "obj" is the identifier that we'll use to refer
                   // to the remote object that implements the "Hello"
                   // interface
                   Message obj = null;
                   Registry r = LocateRegistry.getRegistry(InetAddress.getLocalHost().getHostName(),4646);
                   obj = (Message)r.lookup("Server");
                   String[] s = r.list();
                   for(int i = 0; i < s.length; i++)
                        System.out.println(s);
                   String[] arg = null;
                   System.out.println(obj.passArgs());
                   arg = obj.passArgs();
                   System.out.println(arg[0]+"\n"+arg[1]+"\n"+arg[2]+"\n");
              } catch (Exception e) {
                   System.out.println("Client exception: " + e.getMessage());
                   e.printStackTrace();
    The Message interface has the code:
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    public interface Message extends Remote
         String[] passArgs() throws RemoteException;
    Plz. help. Urgent.
    Regards,
    LioneL

    hi Lionel,
    have u got the problem solved ?
    actually i need ur help regarding RMI - SSL
    do u have RMI - SSL prototype or sample codings,
    i want to know how to implement SSL in RMI
    looking for ur reply
    -shafeeq

  • MM Help plz Urgent

    Hi,
    I want to see Purchase order wise report. The report should show PO wise payment in FI.
    PO field is EBLEN and i am unable to find its link to BSIK or BSAK. The reason is that they are not maintaining EBELN in both these table. I tried on LIFNR but LIFNR is for Vendor only and the requirement is for EBELN means in PO.
    Please anyone help me out in this regard and also plz tell me any detail tables hierarchy of all modules.
    Thanks
    Usman Malik

    hi,
    to get payment details w.r.t. PO, you can use the table BSEG, field ZUONR.
    this field contains PO number concatenated by item no. Eg: 450001728600020
    here 00020 is item no. you can mention BUKRS, GJAHR  and SHKZG as 'S'  in selection criteria for BSEG. Get the accounting document ' BSEG-BELNR' and BSEG -GJAHR. Concantenate this and input in BSIK-ZUONR to get the required data.
    hope it helps.

  • ALV Help plz urgent

    Hi,
    Can anyone help me with ALV that how to display ALV Column Heading in Multiple Line.
    Means Multiple line Coulmn heading of ALV.
    Please fell free to contact me at
    [email protected]
    Regards,
    Muhammad Usman Malik
    SAP ABAP Consultant
    Siemens Pakistan
    +92-333-2700972

    Welcome to SDN.
    Copy Paste below code and execute the same. The output contains mutiple lines in header but I dont know how to do it in ALV. May be of some help to you.
    REPORT  ztestvib    MESSAGE-ID zz  LINE-SIZE 50.
    TYPE-POOLS: slis.
    DATA: x_fieldcat TYPE slis_fieldcat_alv,
          it_fieldcat TYPE slis_t_fieldcat_alv,
          l_layout TYPE slis_layout_alv,
          x_events TYPE slis_alv_event,
          it_events TYPE slis_t_event.
    DATA: BEGIN OF itab OCCURS 0,
          vbeln LIKE vbak-vbeln,
          posnr LIKE vbap-posnr,
          male TYPE i,
          female TYPE i,
         END OF itab.
    SELECT vbeln
           posnr
           FROM vbap
           UP TO 20 ROWS
           INTO TABLE itab.
    x_fieldcat-fieldname = 'VBELN'.
    x_fieldcat-seltext_l = 'VBELN'.
    x_fieldcat-tabname = 'ITAB'.
    x_fieldcat-col_pos = 1.
    APPEND x_fieldcat TO it_fieldcat.
    CLEAR x_fieldcat.
    x_fieldcat-fieldname = 'POSNR'.
    x_fieldcat-seltext_l = 'POSNR'.
    x_fieldcat-tabname = 'ITAB'.
    x_fieldcat-col_pos = 2.
    APPEND x_fieldcat TO it_fieldcat.
    CLEAR x_fieldcat.
    x_fieldcat-fieldname = 'MALE'.
    x_fieldcat-seltext_l = 'MALE'.
    x_fieldcat-tabname = 'ITAB'.
    x_fieldcat-col_pos = 3.
    APPEND x_fieldcat TO it_fieldcat.
    CLEAR x_fieldcat.
    x_fieldcat-fieldname = 'FEMALE'.
    x_fieldcat-seltext_l = 'FEMALE'.
    x_fieldcat-tabname = 'ITAB'.
    x_fieldcat-col_pos = 3.
    APPEND x_fieldcat TO it_fieldcat.
    CLEAR x_fieldcat.
    x_events-name = slis_ev_top_of_page.
    x_events-form = 'TOP_OF_PAGE'.
    APPEND x_events  TO it_events.
    CLEAR x_events .
    l_layout-no_colhead = 'X'.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
      EXPORTING
        i_callback_program = sy-repid
        is_layout          = l_layout
        it_fieldcat        = it_fieldcat
        it_events          = it_events
      TABLES
        t_outtab           = itab
      EXCEPTIONS
        program_error      = 1
        OTHERS             = 2.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    *&      Form  top_of_page
          text
    FORM top_of_page.
    *-To display the headers for main list
      FORMAT COLOR COL_HEADING.
      WRITE: / sy-uline(103).
      WRITE: /   sy-vline,
            (8) ' ' ,
                 sy-vline,
            (8)  ' ' ,
                 sy-vline,
            (19) '***'(015) CENTERED,
                 sy-vline.
      WRITE: /   sy-vline,
            (8) 'VBELN'(013) ,
                 sy-vline,
            (8) 'POSNR'(014) ,
                 sy-vline,
            (8) 'MALE'(016) ,
                 sy-vline,
             (8)  'FMALE'(017) ,
                 sy-vline.
      FORMAT COLOR OFF.
    ENDFORM.                    "top_of_page

  • "Very Serious threat for N70" Help Plz.Urgent

    My Nokia N70 M trinig to call to a unknown no. without my permission.
    When I kept my phone idle, after some time phone lights will turn on and it says "In ur account there is no enough balance to call" and 3 beep sound of disconnecting the call.(The message is in my local language) It is just like a message from my network provider.
    But I have enough balance and I can call to my local numbers.
    Can anyone help??????
    It is a virus?????
    Give me one answer
    Solved!
    Go to Solution.

    Well, it could be a virus, although i never heard of it. Only viruses i know are CommWarrior and Caribe. One of them sends MMS's during night, usually around 4 am and sends the virus via bluetooth during the day.
    Anyway, that really seems you have some type of client installed on your phone. i would recommend to save only your important information, format the phone (typing *#7370#) and format your memory card. I'm positive that will be enough.
    Regards,
    Rodolfo Rangel

  • Help plz~ URGENT: Display image icon with specific coordinates

    I want to view an ImageIcon with specific cooridnate (ie, I know the coordinate of the top left hand corner, and i know the height and the width of the "want to display part")
    how can i make it such that it will onli view the part i want?
    for example
    i want to display say from (40, 40) (left hand corner) to (90,90) (right hand corner)
    ImageIcon thePic= new ImageIcon("theimage.jpg");
    ImageIcon newPic= new ImageIcon( XXXXXXXXX);
    what should i put at the XXXXXXXXXX part?
    Thanks in advance!

    Use getSubImage method of BufferedImage. Something like:
    Image originalImage = ImageIO.read(imageFile) ;// see ImageIO API
    Image scaledImage = originalImage.getScaledInstance(40.40,90,90);
    ImageIcon imageIcon = new ImageIcon(scaledImage);ImageIO.read is overloaded for files, inputStreams and URL's so you can choose how to load it.
    I'll leave the rest to you
    DB

  • Help plz urgent!!!!!

    I am using SAXParser:
    How to overload startElement, endElement and charcaters method in MyClass. Is that possible because I need three different implementations for all these methods based on the command line options.
    thanx in advance!

    I guees this is a little too late..but a better way is to have a
    main class that use three different ContentHandler. this way..you can add more handler with little modification to the code.
    eg
    public class Example{
       int handler;  // type of contentHandler to use
       public static void main(String args[]){
          try{ handler = Integer.parseInt(args[0]) }
          catch (NumberFormatException e) { System.err.println(e); }
       public void parse(String xmldoc){
           ContentHandler chandler;
           switch (handler){
              case 0: chandler  = new myHandler1(currQuery);    break;
              case 1: chandler  = new myHandler2(currQuery);    break;
              case 2: chandler  = new myHandler3(citationList); break;
              default: chandler = new myHandler1(currQuery);    break;
           XMLReader saxReader = XMLReaderFactory.createXMLReader(vendor);
           saxReader.setContentHandler(chandler);
           InputSource inputSource = new InputSource(new StringReader(xmldoc));
           saxReader.parse(inputSource);    
    public class myHandler1 extends DefaultHandler{
        public void startElement(String ns, String name, String qName,  
                Attributes atts) throws SAXException {
            // do something
        public void characters(char[] ch, int start, int length) throws
        SAXException {
            // do something
       public void endElement(String ns, String name, String qName) throws
       SAXException {
           // do something
    public class myHandler2 extends DefaultHandler{
        public void startElement(String ns, String name, String qName,  
                Attributes atts) throws SAXException {
            // do something
        public void characters(char[] ch, int start, int length) throws
        SAXException {
            // do something
       public void endElement(String ns, String name, String qName) throws
       SAXException {
           // do something
    public class myHandler3 extends DefaultHandler{
        public void startElement(String ns, String name, String qName,  
                Attributes atts) throws SAXException {
            // do something
        public void characters(char[] ch, int start, int length) throws
        SAXException {
            // do something
       public void endElement(String ns, String name, String qName) throws
       SAXException {
           // do something

  • !!!Urgent: Boolean array to number!!!

    I am trying to convert boolean array to number but I guess it has some limits. I have a boolean array containing 50 elements I want to convert that into number but it is not happening can anyone help. Its urgent.
    The best solution is the one you find it by yourself

    In a hurry I missed it. Let me explain now
    1. I tried to convert a boolean array to a number as I had more than 40 elements I was getting only zero because of the limitation of I32 I know that I have to change the representation to 64bit but dont know where to do.
    2. Then in the Boolean array to number function when I select the properties there I got the option for changing the representation to 64 bit. (This I totally missed when I was busy searchng a function outside to convert the output to a 64 bit value )
    3. Now I got what I expected.
    altenbach wrote:
    I don't understand what that means. Could you be a little bit more clear so others can learn too? Thanks!
    Thanks altenbach for asking.
    The best solution is the one you find it by yourself

  • Lsmw issue plz help its urgent

    Hi Experts ,
    i need to create a LSMW using batch input .
    but the requirement is on the basis of conditions my recording need to be changed .
    dat means
    3127POL09 3127POL09-1 CTR 3127-1003E 100 FUL
    3127POL09 3127POL09-2 WBS 3127POL01 60 FUL
    for ctr i ill have to post data in screen number 200
    and for wbs i ill have to post data in screen number 400 .
    can we put some conditions in recording in lsmw ?
    i no we can create multiple recording but how can we use them to fullfill my requirement .
    plz help its urgent
    thanx in advance

    Hi,
    Within LSMW, there is an option to write our own code wherein this code can be incorporated.
    This is in the Field Mapping Option...
    Just go to the Menu Extras->Layout
    and click on the check box Form Routines
    Global Data.
    Here you can define Global Variables and also perform your ABAP Coding.
    Regards,
    Balaji.

  • Migration to an asm instance. plz help me urgent

    RMAN> BACKUP AS COPY DATABASE FORMAT '+DGROUP1';
    Starting backup at 20-AUG-07
    Starting implicit crosscheck backup at 20-AUG-07
    using target database controlfile instead of recovery catalog
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=328 devtype=DISK
    ORA-19501: read error on file "+DGROUP1/sravan/backupset/2007_08_03/nnsnf0_ora_asm_migration_0.260.1", blockno 1 (blocksize=512)
    ORA-17507: I/O request size is not a multiple of logical block size
    Crosschecked 7 objects
    Finished implicit crosscheck backup at 20-AUG-07
    Starting implicit crosscheck copy at 20-AUG-07
    using channel ORA_DISK_1
    ORA-19587: error occurred reading 8192 bytes at block number 1
    ORA-17507: I/O request size 8192 is not a multiple of logical block size
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of backup command at 08/20/2007 16:53:21
    ORA-19587: error occurred reading 8192 bytes at block number 1
    ORA-17507: I/O request size 8192 is not a multiple of logical block size

    > plz help me urgent
    Adjective
        * S: (adj) pressing, urgent (compelling immediate action) "too pressing to permit of longer delay";So you are saying that your problem is a lot more important than any other person's problem on this forum?
    And you're demanding a quick response from professionals that give you and others assistance here in their free time without getting a single cent compensation?
    Don't you think that this "it is urgent!" statement severely lacks manners?

  • LASERJET M1217 nfw MFP urgent help plz

    HAY GUYS, NEED URGENT HELP!!!!!!!!!
    My printer M1217 nfw MFP had a problem with the scanner and it was fixed bu updating the firmware and the scanner works fine and offcourse i printed the config. report  befor updating the firmware , the problem is that i lost the report and i cant config. the fax or the wirless connection . any help plz guys  

    kelsaeed wrote:
    HAY GUYS, NEED URGENT HELP!!!!!!!!!
    My printer M1217 nfw MFP had a problem with the scanner and it was fixed bu updating the firmware and the scanner works fine and offcourse i printed the config. report  befor updating the firmware , the problem is that i lost the report and i cant config. the fax or the wirless connection . any help plz guys  

  • Help Plz.......!!!!its urgent

    hi nokia users
    flash lite on my 5530 only plays youtube videos,and when tried to play videos on other sites then it says flash player is required............do ui use any software that supports web videos...???
    help plz.....
    thanks in advance

    Falshplayer vedio cant acces in your device?

  • How to assign values for boolean array in LabVIEW?

    I want assign values for boolean array.Iam not able to do that.For each boolen i want to assign each value.Plz help me......
    Please Mark the solution as accepted if your problem is solved and donate kudoes
    Solved!
    Go to Solution.

    Hi agar,
    values in an array are "assigned" by building an array (using BuildArray) or by replacing values in an existing array (ReplaceArraySubset)!
    Good starting point could be this...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Run Time error!!!Help plz

    hi ..
    every time i run my application i get this error which i can't understand where exactly the error is
    can any one help plz
    )at javax.swing.JLayeredPane.paint(JLayeredPane.java:546
    )at javax.swing.JComponent.paintChildren(JComponent.java:498
    )at javax.swing.JComponent.paint(JComponent.java:669
    )at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:23
    :at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java
    )54
    at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:91
    )at java.awt.Container.paint(Container.java:960
    )at javax.swing.JFrame.update(JFrame.java:329
    )at sun.awt.RepaintArea.update(RepaintArea.java:337
    )at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:200
    )at java.awt.Component.dispatchEventImpl(Component.java:2663
    )at java.awt.Container.dispatchEventImpl(Container.java:1213
    )at java.awt.Window.dispatchEventImpl(Window.java:914
    )at java.awt.Component.dispatchEvent(Component.java:2497
    )at java.awt.EventQueue.dispatchEvent(EventQueue.java:339
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
    )read.java:131
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
    )ad.java:98
    )at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93
    )at java.awt.EventDispatchThread.run(EventDispatchThread.java:85
    this is part of the code:
      public void actionPerformed(ActionEvent e)
        FileInputStream fis = null;
        if (e.getSource() == add) //The ADD button.
          //User has not populated all the input fields.
          if(name.getText().equals("")|| address.getText().equals("")|| phone.getText().equals("")|| sex.getText().equals("")|| dob.getText().equals("")|| photo.getText().equals(""))
            JOptionPane.showMessageDialog(null, "Please fill in all the fields","Missing Fields",JOptionPane.INFORMATION_MESSAGE);
          else
            // save the new customer:
            try
              //1. take the customer's data and photo:
              int    userId          = Integer.parseInt(id.getText());
              String userName      = name.getText();
              String userAddress      = address.getText();
              String userPhone      = phone.getText();
              String userSex      = sex.getText();
              String userDateBirth      = dob.getText();
              //String userDateBirth=Date.parse(dob);
              String photoName      = photo.getText();
              String audioName=   audio.getText();
              File   file           = new File(photoName);
              int    fileLength      = (int)file.length();
              //2. Set the user's photo into the photoHolder:
              photoHolder.setVisible(false);
              photoHolder = null;
              comments.setVisible(false);
              comments = null;
              Icon[] custPhotos = {new ImageIcon(photoName)};
              JList photosList = new JList(custPhotos);
              photosList.setFixedCellHeight(100);
              photosList.setFixedCellWidth(80);
              photoHolder = new JPanel();
              photoHolder.add(photosList);
              makeComments();
              //3. Insert the data and photo into the database:
              if(fileLength > 0)
                fis = new FileInputStream(file);
                String query = " INSERT INTO CUSTOMER VALUES('"+userId+"', '"+ userName+ "', '"+ userAddress+ "', " +" '"+ userPhone+ "', '"+ userSex+ "', '"+ userDateBirth+ "', ?,?,? ) ";
                PreparedStatement pstmt = conn.prepareStatement(query);
                pstmt.setBinaryStream(1, fis, fileLength);
                  pstmt.setString(2,photoName);
                  pstmt.setString(3,audioName);
                pstmt.executeUpdate();
                comments.setText(userName+", added.");
              else
                String query = " INSERT INTO CUSTOMER (id, name, address, phone, sex, dob) VALUES('"+userId+"', '"+userName+"', '"+userAddress+"', '"+userPhone+"', '"+userSex+"', '"+userDateBirth+"') ";
                stat.executeUpdate(query);
                comments.setText("Customer saved without a photo.");
              backPanel.add(photoHolder);
              backPanel.add(comments);
              updateTable();
              //AddScroll();
            } //try
            catch (Exception ee)
               //The danger of putting creating the JOptionPane in here is that it will show the same message regardless of the error.
                JOptionPane.showMessageDialog(null, "Customers CPR already exits!!Please enter another CPR","Invalid",JOptionPane.INFORMATION_MESSAGE);
              System.out.println("Caught exception in add action: " + ee);
              ee.printStackTrace();
            } //catch
          } //if
        }//add button

    hi...
    i got where the error is..
    now i have another problem..
    Connecting to database..
    Valid Login
    Caught updateTable exception: java.lang.ArrayIndexOutOfBoundsException
    java.lang.ArrayIndexOutOfBoundsException
    at UtilityMethods.updateTable(UtilityMethods.java:305)
    (which is this line:
    tableData[currentRow] = fieldString;)-----> i did this because one of the fields will be a Date and the others are strings
    at UtilityMethods.updateTable(UtilityMethods.java:429)
    at Login.validLogin(Login.java:114)
    at Login.actionPerformed(Login.java:80)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
    50)
    at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
    ctButton.java:1504)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
    .java:378)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:250
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
    istener.java:216)
    at java.awt.Component.processMouseEvent(Component.java:3715)
    at java.awt.Component.processEvent(Component.java:3544)
    at java.awt.Container.processEvent(Container.java:1164)
    at java.awt.Component.dispatchEventImpl(Component.java:2593)
    at java.awt.Container.dispatchEventImpl(Container.java:1213)
    at java.awt.Component.dispatchEvent(Component.java:2497)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2451
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2216)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2125)
    at java.awt.Container.dispatchEventImpl(Container.java:1200)
    at java.awt.Window.dispatchEventImpl(Window.java:914)
    at java.awt.Component.dispatchEvent(Component.java:2497)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:339)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
    read.java:131)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
    ad.java:98)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:85)
    this is the code :
    void updateTable()
          ResultSet results = null;
          ResultSet results1 = null;
          try
            //Get the number of rows in the table so we know how big to make the data array..
            int rowNumbers  = 0;
            int columnCount = 6;
            results = stat.executeQuery("SELECT COUNT(*) FROM CUSTOMER ");
            if(results.next())
              rowNumbers = results.getInt(1);
            } //if
            if(rowNumbers == 0)
            rowNumbers = 1;
            tableData = new String[rowNumbers][columnCount];
            //Initialize the data array with "" so we avoid possibly having nulls in it later..
            for(int i =0;i<tableData.length;i++)
              for(int j=0;j<tableData[0].length;j++)
              tableData[i][j] = "";
            //Populate the data array with results of the query on the database..
            int currentRow = 0;
             SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");
            results1 = stat.executeQuery("SELECT * FROM CUSTOMER ORDER BY ID");
            while (results1.next())
              for(int i = 0; i < columnCount; i++){
              Object field = results1.getObject(i + 1);
              // actually this next line should be put outside your loop so you don't keep creating this object
              // or whatever format you want
              String fieldString;
              if (field instanceof Date)
                     fieldString = sdf.format((Date) field);
                     else
                          fieldString = field.toString();
                          tableData[currentRow] = fieldString;
    //tableData[currentRow][i] = results1.getString(i + 1);
    currentRow++;
    } //while
    }//for
    final String[] colName = { "CPR", "Name", "Address", "Phone", "Sex", "Date OF Birth" };
    TableModel pageModel = new AbstractTableModel()
    public int getColumnCount()
    return tableData[0].length;
    } //getColumnCount
    public int getRowCount()
    return tableData.length;
    } //getRowCount
    public Object getValueAt(int row, int col)
    return tableData[row][col];
    } //getValueAt
    public String getColumnName(int column)
    return colName[column];
    } //getcolName
    public Class getColumnClass(int col)
    return getValueAt(0, col).getClass();
    } //getColumnClass
    public boolean isCellEditable(int row, int col)
    return false;
    } //isCellEditable
    public void setValueAt(String aValue, int row, int column)
    tableData[row][column] = aValue;
    } //setValueAt
    //dataTable.setValue( new JScrollBar(JScrollBar.HORIZONTAL), 2,1 );
    }; //pageModel
    //Create the JTable from the table model:
    JTable dataTable = new JTable(pageModel);
    // dataTable.setModel();

  • Programmat​ically Cycle through Boolean Array

    I'm using an Agilent 34970 with a 34901A switch module. It has 16 switches going to two commons. The end function is to switch through all the sources to read resistance and voltage.
    The driver and sample vi from the NI idnet were used as a base for my vi.
    The sample vi uses a user-controlled 2-d boolean array (false = open). I want to be able to programmatically cycle through all the switches, but I don't know how to tell the dimensions of array I have.
    I would like to go through every element of the 2nd raw for each element in the 1st row. If I could programmatically ignore elements #9, 10, 19, and 20, that would be helpful too.
    Thanks for any help!
    Attachments:
    Agilent 34970 Advanced Scan-2U test-1.vi ‏31 KB
    Agilent 34970 Switch-2U test.vi ‏23 KB

    CelerityEDS wrote:
    Is there a way to determine what's in the vi front panel right now? I cannot determine if it's 2x10 or 10x2... There are no properties of the 2-d array that plainly tell me.
    There is "array size" which tells you the actual size of the 2D array.
    There are properties that tell you how many rows and columns are visible in the front panel array container.
    There are also properties that tell which element is currently scrolled to the top left corner.
    The size and index position of the front panel array control or indicator is not related to the actual array size. You can show only 2x2 elements of a 1000x1000 array or vice versa. if the container is too big, the extra elements are greyed. 
    LabVIEW Champion . Do more with less code and in less time .

Maybe you are looking for