Results 1 to 2 of 2
  1. #1
    smakkena is offline Member
    Join Date
    Aug 2011
    Posts
    1
    Rep Power
    0

    Default How to not display a value from dropdown which is populated from database using java

    Can somebody help me how to not display a value from dropdown which is populated from database using java. Lets say the value is 'ABC'
    Here is my code for populating from the database



    1. public List findAllTypes(String state, String grp) {
    2. state = state.substring(0, 2).toUpperCase();
    3. state = StateConverter.convert(state);
    4. String sql = null;
    5. sql = "exec sp_all_types ?";
    6.
    7. logger.debug("findAllTypes SQL: " + sql + "[" + state + "]");
    8. ArrayList params = new ArrayList();
    9. int indx = 0;
    10.
    11. params.add(indx++, state);
    12. int types[] = new int[params.size()];
    13. for (int i=0; i<params.size(); i++)
    14. types[i]=Types.VARCHAR;
    15.
    16. List list = getJdbcTemplate().query(sql, params.toArray(new Object[params.size()]), types, new TypeRowMapper());
    17. logger.debug("Category/Type length: " + list.size());
    18. return list;
    19. }

  2. #2
    sibernewf is offline Member
    Join Date
    Mar 2011
    Posts
    48
    Rep Power
    0

    Default

    Just a thought, but maybe once you have your List, you could simply iterate through the list looking for the entry(ies) you dont want and delete the entry you dont want?

Similar Threads

  1. options already selected from dropdown list based on database request.
    By sauravsinha in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 03-29-2010, 10:46 AM
  2. How to display database in table
    By tamnc in forum SWT / JFace
    Replies: 0
    Last Post: 03-15-2010, 05:57 AM
  3. Autosuggest dropdown based on key entered from database
    By gorthiravikiran in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 04-10-2009, 07:38 AM
  4. Java database/method display problem
    By thelinuxguy in forum Advanced Java
    Replies: 3
    Last Post: 02-20-2009, 07:56 PM
  5. getting values from database in dropdown
    By aa74 in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 04-21-2008, 10:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •