package ber.db; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; public class Uzenofal { public static void main(String[] args) { try { Class.forName("com.mysql.jdbc.Driver"); // Load the driver // connect to the database. Connection conn = DriverManager.getConnection("jdbc:mysql://home.cab.u-szeged.hu/test", "", ""); Statement stmt; // ------------------------------------------------ query the test table stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery("select * from uzenofal"); // run the query while ( rs.next() ) { System.out.println( rs.getObject(1) + " "+ rs.getObject("txt") + " "+ rs.getObject("datum") ); } stmt.close(); conn.close(); } catch (Exception e ) { e.printStackTrace(); } } }