title: Strange problem with JDBC, select returns null
body: <p>I am trying to use JDBC and my query is working in some cases but not working in others.
  I would really appreciate any help.</p>
  
  <p>Some of my code:</p>
  
  <pre><code>public Result getSpecificTopic()
      {
          String query = "Select msg_body, msg_author from lawers_topic_msg";// where msg_id=2 order by msg_id desc";
           try
          {
              con = mysql.getConnection();
              //Statement stmt = con.createStatement();
              PreparedStatement stmt = con.prepareStatement(query);
              //stmt.setInt(1, topicId);
              ResultSet rs = stmt.executeQuery(query);
              int rowCount = rs.getRow();
              specificTopic = ResultSupport.toResult(rs);
  
              con.close();
              stmt.close();
          }
          catch(Exception e)
          {
          }
          return this.specificTopic;
      }
  
      public void setTopicId(String num)
      {
          this.topicId = Integer.parseInt(num);
      }
  
      public int getTopicId()
      {
          return this.topicId;
      }
  </code></pre>
  
  <p>However if i change </p>
  
  <pre><code>String query = "Select msg_body, msg_author from lawers_topic_msg";
  </code></pre>
  
  <p>to the </p>
  
  <pre><code>String query = "Select msg_body, msg_author from lawers_topic_msg where msg_id = " + topicId; 
  </code></pre>
  
  <p>Then the resultset retunrs nothing....
  I am breaking my head here and still cannot figure out what is the problem</p>