I have a MySQL database which contains a table in which new data are getting dumped.Now i have made a java program to read the table data.The nature of the data inserted into the table is such that sometimes it is continuously getting added and sometimes getting added after intervals.While my requirement is to read the data from the java application as soon as it gets added into the table ..
As soon as new data gets added into table, I need to read that through my java program and process it. Also I need to read only new rows..
Here is my java class code..
private void Readdata(ResultSet resultSet) throws SQLException {
while (resultSet.next()) {
Date date = resultSet.getDate("datum");
String comment = resultSet.getString("comments");
}
}
In this code if the while condition fails it comes out and stops reading.