I am trying to print table values from database in Java. I have created connection successfully and was able to create a table as well. But I am having trouble with printing the table values.
try
{
Statement stmt = conn.createStatement();
ResultSet rs;
String getValues =
"SELECT * " +
"FROM EMPLOYEE" /*+ this.tableName*/ + " ; ";
//this.executeUpdate(conn, getValues);
rs = stmt.executeQuery(getValues);
String printValues = rs.getString(???Want to print all the table values);
System.out.println(printValues);
System.out.println("Values Retrived");
}
catch (SQLException e)
{
System.out.println("ERROR: Could not get values from table");
e.printStackTrace();
return;
}
}