title: How to retrieve text colum from sql java?
body: <p>I have a table. The table has a column <code>'Column1'</code> which is of type <code>'text'</code>. </p>
  
  <p>How can I retrieve the text and store it as a string? </p>
  
  <p>The below is what I attempted. (But it does not work, I get weird characters back, instead of the data within the database)</p>
  
  <pre><code>   public void getConfigurationXML()
     {
         try
         {            
             Class.forName("java.sql.Driver"); 
             Connection conn=(Connection)DriverManager.getConnection(_url,_user,_pwd); 
             Statement st=conn.createStatement(); 
  
             ArrayList &lt;String[]&gt; result = new ArrayList&lt;String[]&gt;();
             String query ="SELECT Column1 FROM table1";
             ResultSet rs=st.executeQuery(query); 
             int columnCount = rs.getMetaData().getColumnCount();
  
             while(rs.next())
             { 
                 String[] row = new String[columnCount];
                 for (int i=0; i &lt;columnCount ; i++)
                 {
                     row[i] = rs.getString(i + 1);
                 }
                 result.add(row);
             } 
  
             rs.close(); 
             st.close(); 
             conn.close(); 
  
        } 
        catch(Exception e)
        { 
             Logger lgr = Logger.getLogger(Database.class.getName());
             lgr.log(Level.WARNING, e.getMessage(), e);
        }
     }
  </code></pre>