title: Cassandra : How to get the String value of column data irrespective of datatype
body: <p>I am trying to fetch the results from a <code>com.datastax.driver.core.ResultSet</code> and print it:</p>
  
  <pre><code>ResultSet results = getSession().execute("Select * from test.table"); //getsession returns a session
  int numcols = results.getColumnDefinitions().size();
  for ( Row row : results ) {
      for (int colIndex = 0; colIndex &lt; numcols; colIndex++) {
             System.out.println("data: " + row.getString(colIndex));
       }
  }
  </code></pre>
  
  <p><code>row.getString(colIndex)</code> throws an exception in case of datatypes other than String. How will I be able to get a string data irrespective of what data type it is? </p>