handling new line in java
<p>i have written this small code </p>

<pre><code>ResultSet rs=stmt.executeQuery(my_query);
ResultSetMetaData md=rs.getMetaData();
int numColumns =md.getColumnCount();

for (int i=1; i&lt;numColumns+1; i++) {
     String columnName = md.getColumnName(i);
     Final+=columnName;
}


while (rs.next()) {
     for (int i=1; i&lt;numColumns+1; i++) {
          String  output=rs.getString(md.getColumnName(i));
          Final+=output;
     }     
}
</code></pre>

<p>here i want to add  tab space  in String columnName = md.getColumnName(i);</p>

<p>and new line after Final+=output;</p>

<p>I have tried <code>\n</code> <code>\t</code> and <code>newLine()</code> but nothing worked properly, </p>

<p>since i want to have the <code>Final</code> string with all the column_names Plus data into one variable <code>Final</code>. </p>

<p>I am able to get that easily into <code>Final</code> but the issue is that its all in one line so i need to add tab space(columnName) between column and line space (Final) between rows. Please suggest. </p>

<p>thanks in advance. </p>
