I have a quick question. I'm a beginner programmer and for school we need to make a little console code which prints the result of a query in the console. How ever much I tried it didnt work me, all I get is some strange text instead of the query result.

Here's my main class, I also have a second class which is called SimpleDataSourceV2 (this class holds the code for making connection to the mySQL database.

public static void main(String[] args) {

try {

Connection conn = SimpleDataSourceV2.getConnection();

doQuery(conn);

conn.close();

}

catch ( Exception e){

System.out.print(e);

}

}

public static void doQuery(Connection conn) {

try {

Statement stat = conn.createStatement();

ResultSet result = stat.executeQuery("SELECT * FROM employee");

while (result.next()) {

System.out.println(result);

}

result.close();

stat.close();

}

catch ( SQLException e){

System.out.print(e);

}

}

This are the two methods which I use. The employee table holds different information such as name, adress, city, etc.