title: Java ResultSet getString weirdness?
body: <p>This one has me stumped.</p>
  
  <p>I've got a java.sql.ResultSet and I'm pulling string values out of it like so:</p>
  
  <pre><code>address.setAddressLine1(rs.getString("AddressLine1"));
  address.setAddressLine2(rs.getString("AddressLine2"));
  </code></pre>
  
  <p>When I debug and inspect rs.getString("AddressLine1"), the debugger says I've got a 30 character string: "ATTN: ACCOUNTS PAYABLE" (trailing spaces removed).  However, when I inspect my address object immediately after this line, it's reporting that addressLine1 is a 30 character string of <strong>spaces</strong> or some other whitespace.</p>
  
  <p>When I debug and inspect rs.getString("AddressLine2"), the debugger says that I've got a 23 character string: "10 Something Street" (trailing spaces removed).  When I inspect my address object immediately after this line, it's reporting addressLine2 is <strong>null</strong>.</p>
  
  <p>What's really driving me nuts is that this isn't happening with every value, only a few.</p>
  
  <p>My address class is storing plain old strings with totally dumb getters and setters.  Really, I promise!  This is cut &amp; paste with other dumb properties removed:</p>
  
  <pre><code>public class Address implements java.io.Serializable {
  
   private static final long serialVersionUID = 1L;
   private String addressLine1; 
   private String addressLine2; 
  
   public String getAddressLine1() {
    return addressLine1;
   }
  
   public void setAddressLine1(String addressLine1) {
    this.addressLine1 = addressLine1;
   }
  
   public String getAddressLine2() {
    return addressLine2;
   }
  
   public void setAddressLine2(String addressLine2) {
    this.addressLine2 = addressLine2;
   }
  }
  </code></pre>
  
  <p>What in the heck is going on here?  Is it some kind of weird scoping problem?  Is it some kind of character encoding thing?</p>
  
  <p>P.S. - I'm using spring's SimpleJdbcTemplate, and the "pseudo database" I'm talking to is ProvideX which I'm accessing via ODBC (sun.jdbc.odbc.JdbcOdbcDriver).</p>