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("oracle.jdbc.driver.OracleDriver"); // Load the driver // connect to the database. Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@home.cab.u-szeged.hu:1521:oracab10", "", ""); 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.getString("txt") + " " + rs.getTimestamp("datum")); } stmt.close(); conn.close(); } catch (Exception e) { e.printStackTrace(); } } }