Populatin a JList with elements from a DB (access here)

last year i was able to populate a JList with data from a database
however this year something doesnt work
this is last year
public String[] getOnderwerpen()
System.out.println(theConnection==null?" connection null ":" connection niet null ");
String []locaties = new String[30];
ArrayList returnLijst;
returnLijst = new ArrayList();
ArrayList arraylist;
arraylist = new ArrayList();
          String[] deLocaties = null;
try{
String onderwerpQuery = "SELECT OnderwerpID FROM Onderwerp order by OnderwerpID";
Statement statement = theConnection.createStatement();
System.out.println(statement==null?" statement null ":" statement niet null ");
statement.execute(onderwerpQuery);
ResultSet result = statement.getResultSet();
System.out.println(result==null?" ResultSet null ":" ResultSet niet null ");
int i = 0;
               while(result.next())
          //          locaties[i] = result.getString("OnderwerpID");
locaties[i] = result.getString("OnderwerpID");
                                        i++;
deLocaties = new String;
          for (int j=0;j<deLocaties.length;j++)
               deLocaties[j] = locaties[j];
          sorteerStringArray(deLocaties);
}//end-try
catch (Exception e) {
e.printStackTrace();
return deLocaties;
& this is what i did this year
public String[] getbedrijfNaam()
          String[] bedrijfsNamen = new String[Constanten.aantalBedrijven];
          String[] deBedrijfsNamen = null;
     System.out.println(theConnection==null?" connection null ":" connection niet null ");
     System.out.println("test this");
     try{
     String onderwerpQuery = "SELECT naam FROM organisatie";
     Statement statement = theConnection.createStatement();
     System.out.println(statement==null?" statement null ":" statement niet null ");
     statement.execute(onderwerpQuery);
     ResultSet result = statement.getResultSet();
     int i = 0;
                    while(result.next())
                         bedrijfsNamen[i] = result.getString();
                                             i++;
                    deBedrijfsNamen = new String[i];
               for (int j=0;j<deBedrijfsNamen.length;j++)
                    deBedrijfsNamen[j] = bedrijfsNamen[j];
               sorteerStringArray(deBedrijfsNamen);
               statement.close();
               //theConnection.close();
     }//end-try
     catch (Exception e) {
     e.printStackTrace();
     return deBedrijfsNamen;
is there something here thats not right
or does this no longer work because of the changes made in 1.5

last year i was able to populate a JList with data from a database
however this year something doesnt work
this is last year
public String[] getOnderwerpen()
System.out.println(theConnection==null?" connection null ":" connection niet null ");
String []locaties = new String[30];
ArrayList returnLijst;
returnLijst = new ArrayList();
ArrayList arraylist;
arraylist = new ArrayList();
          String[] deLocaties = null;
try{
String onderwerpQuery = "SELECT OnderwerpID FROM Onderwerp order by OnderwerpID";
Statement statement = theConnection.createStatement();
System.out.println(statement==null?" statement null ":" statement niet null ");
statement.execute(onderwerpQuery);
ResultSet result = statement.getResultSet();
System.out.println(result==null?" ResultSet null ":" ResultSet niet null ");
int i = 0;
               while(result.next())
          //          locaties[i] = result.getString("OnderwerpID");
locaties[i] = result.getString("OnderwerpID");
                                        i++;
deLocaties = new String;
          for (int j=0;j<deLocaties.length;j++)
               deLocaties[j] = locaties[j];
          sorteerStringArray(deLocaties);
}//end-try
catch (Exception e) {
e.printStackTrace();
return deLocaties;
& this is what i did this year
public String[] getbedrijfNaam()
          String[] bedrijfsNamen = new String[Constanten.aantalBedrijven];
          String[] deBedrijfsNamen = null;
     System.out.println(theConnection==null?" connection null ":" connection niet null ");
     System.out.println("test this");
     try{
     String onderwerpQuery = "SELECT naam FROM organisatie";
     Statement statement = theConnection.createStatement();
     System.out.println(statement==null?" statement null ":" statement niet null ");
     statement.execute(onderwerpQuery);
     ResultSet result = statement.getResultSet();
     int i = 0;
                    while(result.next())
                         bedrijfsNamen[i] = result.getString();
                                             i++;
                    deBedrijfsNamen = new String[i];
               for (int j=0;j<deBedrijfsNamen.length;j++)
                    deBedrijfsNamen[j] = bedrijfsNamen[j];
               sorteerStringArray(deBedrijfsNamen);
               statement.close();
               //theConnection.close();
     }//end-try
     catch (Exception e) {
     e.printStackTrace();
     return deBedrijfsNamen;
is there something here thats not right
or does this no longer work because of the changes made in 1.5

Similar Messages

  • Fill in form with records from a database

    hi using adobe live cycle desginer could some one guide me or tell me what to look for so i can:
    populate my pdf form with records from a ms access database
    my site is in asp
    thanks

    This [url http://forum.java.sun.com/thread.jsp?forum=57&thread=497641]thread should get you started.

  • Have Photoshop Elements from 2001.  Got new computer with Windows 7 Professional 64 bit.  It won't run on my new computer.  What version is MOST SIMILAR to the old version I have, that will run on W7P-64?  Thanks for any help.  Popjer

    Have Photoshop Elements from 2001.  Got new computer with Windows 7 Professional 64 bit.  It won't run on my new computer.  What version is MOST SIMILAR to the old version I have, that will run on W7P-64?  Thanks for any help.  Popjer

    You should probably just download the trial version of pse 12 and see if you can live with it.
    Download a free trial or buy Adobe products | Adobe downloads
    That being said, have you tried to install pse 1 on your computer?
    How much free space is on your hard drive?
    Do you have Internet Explorer 10 or 11?
    Pse 1 can run on windows 7 x64, provided certain conditions are met.

  • Anyone having problems with Elements organiser 13 when try to import photos from Mac photos which was an upgrade from Iphotos on 9th April 2015. Before when I was using Iphotos all was ok...

    Anyone having problems with Elements organiser 13 when try to import photos from Mac photos which was an upgrade from Iphotos on 9th April 2015. Before when I was using Iphotos all was ok...

    hi I have been trying to do this, but PE13 comes up with a fail message saying that file types are not supported, am only trying to import jpeg files so can't understand this.  So far have been unable to use PE13 at all, any ideas anyone please!

  • How to copy elements from one JList to another JList?

    I have 2 JLists. availableList and selectedList.
    String availableData [] = {"A","B","C","D","E","F"};
    JList availableList = new JList(availableData);
    JList selectedList = new JList();
    Now on 'Copy >>>' action I want the elements from availableList to be copied to selectedList (elements in the first JList should not be removed.)
    on actionPerformed I used: selectedList.setListData(availableList.getSelectedValues()) but it is adding only one element at a time.
    Can anyone help me in solving this problem? I want the elements from availableList to be copied to selevtedList and the duplicate should not happen. No need to sort the selectedList. just adding one by one.
    Thanks in Advance!
    Edited by: DeepakKotla on Oct 9, 2007 5:25 PM

    You might want to use a model to make it easier to add and transfer data
    like using DefaultListModel.

  • HT2518 I don't have .psd files but how do I migrate my Photoshop Elements catalog with tags from Windows

    I don't have .psd files but how do I migrate my Photoshop Elements catalog with tags from Windows?

    That's really disappointing, I purchased the download version.
    I refuse to pay another £55
    Thanks for your help anyway

  • Strange problem with removing element from node

    Hi,
    I have a problem when I removed elements from a node.
    here is the code:
    String text = "123456";
    IANode nodeA= wdContext.nodeA();
    wdContext.nodeB().invalidate();
    IBNode nodeB = wdContext.nodeB();
    for(int i=0; i<nodeA.size(); i++)
    IAElement e = nodeA.getEt_Emp_RespElementAt(i);
    if (e.getID().compareTo(text)!= 0)
         nodeB.removeElement(e);
    else
    wdComponentAPI.getMessageManager().reportSuccess(e.getID() + " was not removed");
    The node A does have a row with field "ID" equals to 123456.
    When running the application, it does write that "123456" was not removed...but it removes it....In fact my table is now empty.
    How is it possible if it didn't perform the remove operation for ID = 123456 ?
    Thanks in advance.

    David,
    Because you are iterating node in wrong direction: see my reply to your post Re: Loop problem (seems that you assigns me 2 points without reading reply, and mark it as solved just because you stop solving it
    So, in example in this thread, you must iterate node B in reverse direction, get element from B and remove it from B if it has some specific ID.
    Valery Silaev
    EPAM Systems
    http://www.NetWeaverTeam.com

  • I'm upgrade from PC to iMac can I just purchase upgrade revision of Lightroom 5 I currently have 4 and not pay the full version price?   Same with Elements 12?  Thanks

    I'm upgrade from PC to iMac can I just purchase upgrade revision of Lightroom 5 I currently have 4 and not pay the full version price?   Same with Elements 12?  Thanks

    lr and pse are both cross-platform apps so you can use both pc and mac versions with those programs.
    for most adobe apps though, How to Move Adobe CC or CS6 Between Computers, or PC to Mac | ProDesignTools

  • Grouping Checks, All element from a group present with all option available in group

    Respected Techie....May i get help on this how to design a query for below condition, if possible.declare @myTable table (PT varchar(50), MK varchar(50), MO varchar(50),
    YR varchar(50), REMARKS varchar(50), PART varchar(50))
    Table Structure:-
    insert into @myTable values ('Battery' ,'Dodge','Ram 50', '1989', 'Four Wheel Drive', '51C') --This will be in Output, as Group of PT, MK,MO,YR have 2 remarks and part are available with both the remarks
    insert into @myTable values ('Battery' ,'Dodge','Ram 50', '1989', 'Rear Wheel Drive', '51X') --This will be in Output, as Group of PT, MK,MO,YR have 2 remarks and part are available with both the remarks
    insert into @myTable values ('Battery' ,'Dodge','Ram 50', '1989', 'Rear Wheel Drive', '51C') --This will be in Output, as Group of PT, MK,MO,YR have 2 remarks and part are available with both the remarks
    insert into @myTable values ('Battery' ,'Dodge','Ram 50', '1989', 'Four Wheel Drive', '51X') --This will be in Output, as Group of PT, MK,MO,YR have 2 remarks and part are available with both the remarks
    insert into @myTable values ('Air Filter','Dodge','Colt', '1990', 'Four Wheel Drive', '46264') -- This will be in Output, as Group of PT, MK,MO,YR have 2 remarks and part are available with both the remarks
    insert into @myTable values ('Air Filter','Dodge','Colt', '1990', 'Four Wheel Drive', '875') --This will be in Output, as Group of PT, MK,MO,YR have 2 remarks and part are available with both the remarks
    insert into @myTable values ('Air Filter','Dodge','Colt', '1990', 'Front Wheel Drive','46264') --This will be in Output, as Group of PT, MK,MO,YR have 2 remarks and part are available with both the remarks
    insert into @myTable values ('Air Filter','Dodge','Colt', '1990', 'Front Wheel Drive','875') --This will be in Output, as Group of PT, MK,MO,YR have 2 remarks and part are available with both the remarks
    insert into @myTable values ('Bull Bar' ,'Ford','F-250', '1997', 'Four Wheel Drive', '1330371971') --All element from a group of PT,MK,MO,YR should be Removed from output, as Part 1330371971 is not available with all the remarks available in a group. (1330371971 is not available with Rear Wheel Drive.)
    insert into @myTable values ('Bull Bar' ,'Ford','F-250', '1997', 'Four Wheel Drive', 'NR-301') --All element from a group of PT,MK,MO,YR should be Removed from output, as Part 1330371971 is not available with all the remarks available in a group. (1330371971 is not available with Rear Wheel Drive.)
    insert into @myTable values ('Bull Bar' ,'Ford','F-250', '1997', 'Rear Wheel Drive', 'NR-301') --All element from a group of PT,MK,MO,YR should be Removed from output, as Part 1330371971 is not available with all the remarks available in a group. (1330371971 is not available with Rear Wheel Drive.)
    insert into @myTable values ('Controls', 'Cadillac','Chasis','1992', 'Rear Wheel Drive', 'CK620158') --Removed from output, as group by PT,MK,MO,YR contain only 1 remarks and 1 distinct part
    insert into @myTable values ('Controls', 'Cadillac','Chassis','1992','Rear Wheel Drive', 'CK620159') --Removed from output, as group by PT,MK,MO,YR contain only 1 remarks and 1 distinct partThank You Very Much

    It would certainly help with some more details on the business rules.
    I am puzzled over these two rows:
    insert into @myTable values ('Bull Bar'   ,'Ford','F-250',   '1997',   'Four Wheel Drive',   'NR-301')  
       --All element from a group of PT,MK,MO,YR should be Removed from output, as Part  1330371971 is not available with all the remarks available in a group. (1330371971 is not available with Rear Wheel Drive.)
    insert into @myTable values ('Bull Bar'   ,'Ford','F-250',   '1997',   'Rear Wheel Drive',   'NR-301')  
       --All element from a group of PT,MK,MO,YR should be Removed from output, as Part  1330371971 is not available with all the remarks available in a group. (1330371971 is not available with Rear Wheel Drive.)
    Overlooking the fact that the part number in the comment does not match, how this is different from parts 51C and 51X which also has a Four Wheel Drive and a Rear Wheel Drive?
    I guess the real question is how do I know what "all available options" are? I would kind of expect a table which defines this.
    And please don't forget to tell us which version of SQL Server you are using!
    Erland Sommarskog, SQL Server MVP, [email protected]

  • I am trying to install photoshop elements from the shop bought card. After I put in redemption code the yellow line came up with "redemption is not available at the moment". What do I do?  Please help! Many thanks

    I am trying to install photoshop elements from the shop bought card. After I put in redemption code the yellow line came up with "redemption is not available at the moment". What do I do?  Please help! Many thanks

    There's been a few of these today. I think there must be a problem with the redemption server and you probably just need to wait a while and try again.
    Cheers,
    Neale
    Insanity is hereditary, you get it from your children
    If this post or another user's post resolves the original issue, please mark the posts as correct accordingly. This helps other users with similar trouble get answers to their questions quicker. Thanks.

  • I try to create an html for IPad. The html page contains an element overlapping a video, now it works as for view but the focus is still with video. This denies the event of overlapping element from occuring. Can please anyone help to solve this issue?

    I try to create an html for IPad. The html page contains an element overlapping a video, now it works as for view but the focus is still with video. This denies the event of overlapping element from occuring. Can please anyone help to solve this issue?

    Hello,
    '''Try Firefox Safe Mode''' to see if the problem goes away. Safe Mode is a troubleshooting mode, which disables most add-ons.
    ''(If you're not using it, switch to the Default theme.)''
    * On Windows you can open Firefox 4.0+ in Safe Mode by holding the '''Shift''' key when you open the Firefox desktop or Start menu shortcut.
    * On Mac you can open Firefox 4.0+ in Safe Mode by holding the '''option''' key while starting Firefox.
    * On Linux you can open Firefox 4.0+ in Safe Mode by quitting Firefox and then going to your Terminal and running: firefox -safe-mode (you may need to specify the Firefox installation path e.g. /usr/lib/firefox)
    * Or open the Help menu and click on the '''Restart with Add-ons Disabled...''' menu item while Firefox is running.
    [[Image:FirefoxSafeMode|width=520]]
    ''Once you get the pop-up, just select "'Start in Safe Mode"''
    [[Image:Safe Mode Fx 15 - Win]]
    '''''If the issue is not present in Firefox Safe Mode''''', your problem is probably caused by an extension, and you need to figure out which one. Please follow the [[Troubleshooting extensions and themes]] article for that.
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.''
    ''When you figure out what's causing your issues, please let us know. It might help other users who have the same problem.''
    Thank you.

  • Retrieving all UI Elements from window with Applescript

    Hi All..
    I want to retrieve all the ui elements from one of the window in runtime with Applescript.
    The problem is in order to get the elements of the particular window i need to pass thru the hierarchy like UI element 1 of scroll area 1 of window 1 etc..
    How do i get the hierarchy at the runtime??
    For eg: if the hierarchy level is 3, i can get the UI elemets like.. ui elements of ui elements of ui elements of window 1.. this works fine
    but i want to repeat the same statement in loop, till i get some elements, how do i achieve the same??
    I tried the below code its not working for me... Pls suggest
    set allButtons to {}
    set i to 0
    tell application "System Events"
        tell process "Install Adobe Reader"
            set num to count of UI elements of window 2
            set element to every UI element of window 2
                  repeat with i from 0 to num
                if class of element is button then
                    return true
                else
                    set element to (a reference to UI elements of element)
                    set num to count of UI elements of element
                    end if
            end repeat
        end tell
    end tell

    madhusudhanjr wrote:
    actually am implementing Applescripts in Java, the output what we get in Java is not exactly similar to Applescript.. Is their any way to make a list or Array of the above codes output??
    Because they are objects.
    Here's how to convert these objects in  text format :
    set allButtons to ""
    tell application "System Events"
          tell process "Install Adobe Reader"
                with timeout of 0 seconds
                      set tElements to entire contents of window 1
                end timeout
                repeat with i in tElements
                      if class of i is button then try
                            i as text
                      on error err
                            tell my cleanUpErr(err) to if it is not "" then set allButtons to allButtons & it & linefeed
                      end try
                end repeat
          end tell
    end tell
    allButtons
    on cleanUpErr(t)
          set oTID to text item delimiters
          try
                set text item delimiters to "«" -- remove description of the error at beginning of the text
                set t to "«" & (text items 2 thru -1 of t) as text
                set text item delimiters to " of «class pcap»" -- remove 'of process "xxxx" of application "System Events"'
                set r to text item 1 of t
                set text item delimiters to oTID
                return r -- return object in text format
          end try
          set text item delimiters to oTID
          return ""
    end cleanUpErr
    You will get a button to each line (the last line will be empty).
    Here is an example of the result :
    «class butT» 1 of window "xyz"
    «class butT» "bla" of window "xyz"
    «class butT» 3 of window "xyz"
    «class butT» "OK" of «class scrb» 1 of «class scra» 1 of window "xyz"
    Each line is compilable in (osascript or in the Editor) without changing the text even if some of the classes are Raw Code --> «class butT»

  • I talked with Adobe Yesterday about removing Elements from my Mac, if there were any concerns with Lightroom 5 and Photoshop CS6

    The answered no, that all I needed to do with Elements was to drag it to the Trash. I did that. Now in Lightroom 5 do I not see Photoshop in the EDIT IN menu, all my plug-is are missing as well! Ive found two papers on the subject, one for both programs where they say to find the Lightroom fine "com.adobe.Lightroom5.plist" and a similar Photoshop fine in >user>Library>Preferences. Neither exist on my mac! Im in a process of a system search to make sure, but so far, no good!
    I'm looking for a fix, PLEASE. To stop and delete both programs, reinstall this and ALL the plug-in's isn't something I want to contemplate if I don't have to!

    Sorry Keith, I didn't look at it as a duplicate post since I initually approached it as a Photoshop issue and have since come to see it as a lightroom issue. I've subedquently found the photoshop preference file, deleted it and restarted Photoshop which recreated that file. That didn't help.
    SInce my initial concern was with Photoshop I failed to notice than none of the Lightroom plug ins were showing up. Researching that fix, what I found was essentially the same as with Photishop except the Lightroom preference file. Now I'm not finding that file but I'm doing a full system search.
    Some caveats to all of this are, the photoshop and Lightroom plug ins are the same. Theyre resident and run in CS6. Additionally in Lightroom if I go to preferances> external edit, I see photoshop and all the plug ins listed there.

  • Set file name with XSLT - receiver channel - elements from XML?

    Dear experts,
    I have an XSLT mapping for a message that is sent via a receiver channel to a customer.
    The customer wants a certain file name which is put toghether by elements from the XML message.
    I have looked at:
    Re: Java Map for writing the file
    The java code and the XSLT work perfectly!
    In the line
    fos = new FileOutputStream(new File("Fixed_" + new Date().getTime() + ".xml"));
    a fixed value, date and time are used for the file name.
    But I need some values from the XML message to create my name. But how do I do that? Can I somehow get values from the XML message through that java function or do I have to adapt the XSLT?
    Can someone please help me!
    Thank you,
    Peter

    Hi Udo, Hello experts,
    Now I do have a problem. I am using this XSL file:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:map="java:java.util.Map"
      xmlns:dyn="java:com.sap.aii.mapping.api.DynamicConfiguration"
      xmlns:key="java:com.sap.aii.mapping.api.DynamicConfigurationKey">
    <xsl:output indent="no" />
    <xsl:param name="inputparam"/>
    <xsl:template match="/">
        <!-- change dynamic configuration -->
        <xsl:variable name="dynamic-conf" 
            select="map:get($inputparam, 'DynamicConfiguration')" />
        <xsl:variable name="dynamic-key"  
            select="key:create('http://sap.com/xi/XI/System/File', 'FileName')" />
        <xsl:variable name="dummy"
            select="dyn:put($dynamic-conf, $dynamic-key, 'TOOLDATA_.xml')" />
      <xsl:copy-of select="." />
    </xsl:template>
    </xsl:stylesheet>
    But then the output file is only named "TOOLDATA_.xml". So I assume the XSL is working.
    And I am using this Java-file:
    package pi_mappings;
    import com.sap.aii.mapping.api.*;
    import java.io.*;
    import java.util.*;
    public class SetFileName extends AbstractTransformation
         static final int BUFFER = 1024*1000;
        private Map param;
        public SetFileName(){  }
         public void setParameter (Map map)
              param = map;
              if (param == null)
                   param = new HashMap();
         public static void main(String args[])
              try
                   InputStream in = new FileInputStream(args[0]);
                   OutputStream out = new FileOutputStream(args[1]);
                   SetFileName sfn = new SetFileName();
                   //sfn.setParameter(mapOfMap);
                   sfn.execute(in, out);
              catch (Exception e)
                        e.printStackTrace();
        public void execute(InputStream inputstream, OutputStream outputstream)
        throws StreamTransformationException {
              try
                   DynamicConfiguration conf = (DynamicConfiguration) param.get("DynamicConfiguration");
                   DynamicConfigurationKey KEY_FILENAME = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
                   int len = 0;
                   byte buf[] = new byte[BUFFER];
                   FileOutputStream fos = null;
                   if (conf != null)
                        fos = new FileOutputStream(new File(conf.get(KEY_FILENAME) + new Date().getTime()) ); //sample only
                   else
                        fos = new FileOutputStream(new File("Fixed_" + new Date().getTime() + ".xml"));
                        while ((len = inputstream.read(buf)) > 0)
                             outputstream.write(buf, 0, len);
                             fos.write(buf, 0, len);
                        fos.close();          
              catch(Exception e){ e.printStackTrace();}
         public void transform(TransformationInput arg0, TransformationOutput arg1)
         throws StreamTransformationException {
              getTrace().addInfo("JAVA Mapping Called");
         this.execute(arg0.getInputPayload().getInputStream(), arg1
              .getOutputPayload().getOutputStream());
    Could you please help me find the mistake. I tried to test it locally by changing the main-method but I could not get it to work.
    Thank you very much for any ideas!
    Best regards,
    Peter

  • How to retrieve elements from 3 different xml file in one url

    Hi all,
    Could anyone please let me how can we retrieve elements from 3 different xml file in one url?
    i just can only do it with one file only, any help would very appreciate.
    Thank in advance
    Jim

    Hi Philip
    Thanks for replying me.
    I tried on that way, In my mdx query i am using one slice attribute (i.e [Customer].[Gender].allmembers) in rows so getting error "The  Hierarchy already appears in Axis1".
    SELECT
    {[Measures].[Internet Sales Amount] } ON 0,
    NON EMPTY
    {[Customer].[Gender].allmembers } ON 1 -- Used
    FROM
    [Adventure Works]
    WHERE
    [Customer].[Gender].&[M]
    ,[Product].[Size Range].[(All)]
    ,[Customer].[Country].[All Customers]
    [Customer].[Gender].[All Customers]
    ,[Product].[Size Range].&[XL]
    ,[Customer].[Country].[All Customers]
    [Customer].[Gender].[All Customers]
    ,[Product].[Size Range].[(All)]
    ,[Customer].[Country].&[Australia]
    Can you provide alternate ways to get resolved.
    Thanks in advance

Maybe you are looking for