import java.sql.*; import com.mysql.jdbc.Driver; public class mysqltest{ public static void main(String[] args) { System.out.println("Start mysqltest"); try { Class.forName("com.mysql.jdbc.Driver").newInstance(); Connection connection = DriverManager.getConnection("jdbc:mysql://10.0.4.209/EPPAData?user=EPPAUser&password="); Statement s = connection.createStatement(); ResultSet r = s.executeQuery("SELECT * FROM Experiments WHERE user = 'default' ORDER BY user,name,W,ID"); while(r.next()) { System.out.println("Exp "+r.getString("name")+" "+r.getString("ID")+" "+r.getString("p")+" "+r.getString("W")); } s.close(); // Also closes ResultSet } catch (Exception e){ System.out.println("MYSQL error"); e.printStackTrace(); } System.out.println("End mysqltest"); } }