Announcement Announcement Module
Collapse
No announcement yet.
queryForList issue..is it case-sensitive? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • queryForList issue..is it case-sensitive?

    Hi All,

    I am facing strange issue with queryForList API.
    String sql="select name from emp where empId=10";
    List list = queryForList(sql);
    Iterator itr= list.iterator();
    if(itr.hasNext()){
    map = (Map)itr.next();
    LOG.info("name:" + map.get("name"));
    }

    Now this works as long as I deploy my application as WAR on webserver. But it stops working when I deploy it as packaged EAR.

    When packaged as EAR
    - map.get("name") returns null. But it works when i use uppercase.....i.e.
    map.get("NAME")

    When packaged as WAR
    - it works for map.get("name") and map.get("NAME") also.

    How come? whats the issue? Isnt it case -sensitive? is there any way to make it case-insensitive.

    Thanks,
    Shriram

  • #2
    wondered about this

    why you have this?
    map = (Map)itr.next();
    LOG.info("name:" + map.get("name"));
    nothing related directly with the db

    tell me, the variable map how is declared ?

    regards

    Comment


    • #3
      Map map =null;

      This is how map variable is declared.

      queryForList method return results will be mapped to a List (one entry for each row) of Maps (one entry for each column using the column name as the key). Each element in the list will be of the form returned by this interface's queryForMap() methods.

      I read somewhere that to make retrival from map case-insensitive we need to use commons-collections-3.2.jar instead of commons-collections-2.1.1.jar

      is it true? whats the rational behind it?

      - Anirudha

      Comment


      • #4
        This all sounds very strange! Is it possible to see the code you are running?
        Last edited by karldmoore; Aug 29th, 2007, 01:08 PM.

        Comment

        Working...
        X