JDBC

  Class.forName("com.mysql.jdbc.Driver");
  String url = "jdbc:mysql://localhost:3306/mysql";
  Connection con = DriverManager.getConnection(url,"root", "");
  Statement stmt = con.createStatement();
  ResultSet rs = stmt.executeQuery(
    "SELECT * FROM users where clue>0");
  while ( rs.next() ) {
    System.out.println(rs.getString("name"));
  }