How to properly print out the acquired data from the database.
Printing out on the console looks like this -> see here
//initialize the connection
try{
Connection conn1=DriverManager.getConnection("jdbc:mysql://localhost/test","root","****");
String query1= "SELECT * FROM student_table";
Statement stmt1= conn1.createStatement();
ResultSet res1=stmt1.executeQuery(query1);
// Print the result
System.out.println("id \t\t "+"name\t\t "+"class\t\t\t "+"age\n");
while(res1.next()){
System.out.println(res1.getString("id")+"\t\t "
+res1.getString("name")+"\t\t "
+res1.getString("class")+"\t\t "
+res1.getString("age"));
}
}catch(Exception e){
System.err.println(e);
}
}