title: Getting null value from table
body: <p>i have a piece of jsp code . this code takes data from a table and displays it on a console
  For <code>integer</code> values it is working good but for <code>String</code> values it displays <code>null</code>
  the issue is not with the <code>table</code> . i have tried other tables also but same result</p>
  
  <p>jsp code :</p>
  
  <pre><code>&lt;%
  int mots_id = 0 ; 
  String mots_name = "" ;
  String accesstype = "" ;
  GetAccess obj = new GetAccess();
  List&lt;GetAccessVO&gt; accesslist = obj.access(attUID);
  if(accesslist!=null)
  {
      Iterator&lt;GetAccessVO&gt; iter = accesslist.iterator();    
  
          while(iter.hasNext())
          {
              GetAccessVO getaccessVO = iter.next();
              mots_id = getaccessVO.getmotsid();
              String  mots_name = getaccessVO.getmotsname();   
              String  accesstype = getaccessVO.getaccess();  
              out.println(accesstype);  // it displays null 
          }  
  } 
  %&gt;
  </code></pre>
  
  <p>java code :</p>
  
  <pre><code>public class GetAccess{
      final static DBConnection db=new DBConnection(); 
      public List&lt;GetAccessVO&gt; access(String attuid)
      {
          List&lt;GetAccessVO&gt; accesslist = new ArrayList&lt;GetAccessVO&gt;();
          try
          {
              Connection con = db.getConnection();
              String query ="select mots_id ,mots_name,access_type from ENV_TEAM where userid = ?";   
              PreparedStatement pstmt = con.prepareStatement(query);
              pstmt.setString(1, attuid);
              ResultSet rs = pstmt.executeQuery();
              while (rs.next()) 
              { 
                  GetAccessVO getaccessVO = new GetAccessVO();
                  getaccessVO.setmotsid(rs.getInt(1));
                  getaccessVO.setmotsname(rs.getString(2));
                  getaccessVO.setaccess(rs.getString(3));
                  accesslist.add(getaccessVO);
              }
              rs.close();
              pstmt.close();
              con.close();
          } 
          catch (Exception e) 
          {
              e.printStackTrace();
          }
          return accesslist; 
      }
  }
  </code></pre>
  
  <p>the setter getter class :</p>
  
  <pre><code>public class GetAccessVO {
  
      private int mots_id;
      private String mots_name;
      private String access;
  
      public String getmotsname() {
          return mots_name;
      }
  
      public void setmotsname(String mots_name) {
          this.mots_name = mots_name;
      }
  
      public int getmotsid() {
          return mots_id;
      }
  
      public void setmotsid(int mots_id) {
          this.mots_id = mots_id;
      }
  
      public String getaccess() {
          return access;
      }
  
      public void setaccess(String access) {
          this.access = access;
      }
  }
  </code></pre>
  
  <p>i have tried almost everything but the <code>String</code> values always are null</p>
  
  <pre><code>SQL&gt; select * from env_team ;
  
  USERID     MOTS_ID MOTS_NAME                      ACCESS_TYPE
  ------- ---------- ------------------------------ ------------------------------
  as045e        7921 BDS                            external
  </code></pre>