import java.net.SocketException; import java.net.UnknownHostException; import java.sql.Connection; import java.sql.Driver; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.Properties; public class Bug69788 { public static void main(String[] args) throws SQLException, ClassNotFoundException, UnknownHostException, SocketException { Class.forName("com.mysql.jdbc.Driver"); Properties pro = new Properties(); pro.setProperty("user", "raminorujov"); pro.setProperty("password", "p1452049"); Driver driver = new com.mysql.jdbc.Driver(); Connection con = driver.connect("jdbc:mysql://localhost:3306/", pro); Statement st = con.createStatement(); ResultSet rs = st.executeQuery("select col_int, col_str, col_datetime, col_date from test.bug69788"); //while (rs.next()) { //System.out.println("testing getInt " + rs.getInt(1)); //System.out.println("testing getString " + rs.getString(2)); //System.out.println("testing getTimestamp " + rs.getTimestamp(3)); System.out.println("testing getDate " + rs.getDate(4)); //} rs.close(); st.close(); con.close(); } }