tags:

views:

35

answers:

1

I am kinda new to this, but I am trying to fill an array from a sql statement that pulls several permit numbers from a table.

So in the table every person can have multiple permits, I need to store all the permit numbers and display them in a drop down box via javascript. I have been able to get at least the first permit, but nothing after that. I know this person has more than one. here is the code I have:

 ResultSet rsTagCheck = stmt.executeQuery("SELECT PARK.XK.XK_PI, PARK.XK.XK_STAT, PARK.XK.XK_EX_YR, PARK.XK.XK_TAG FROM PARK.XK WHERE XK_PI ='" + ID + "'");
        if (rsTagCheck.next()){
           String TagNum = rsTagCheck.getString("XK_TAG");
           String[] tag = new String[101];
           for (int i = 0; i < tag.length; i++)
               tag[i] = TagNum;

Any help would be greatly appreciated. Thanks

A: 

You have to iterate over the ResultSet rsTagCheck. I never used it, but something on the lines of

while (rsTagCheck.next()) {
     ...your code here...
}

should work.

matiasg