Question

I have a Java Db database table that I use to display results in JFreeChart. There are two processes:

  1. updates the table every 30 seconds with data obtained from a temperature sensor
  2. creates a JdbcRowSet from this table, which is used to create a series for the chart

At the moment, the only way I found to get the new data inserted by (1) into the RowSet is by re-running the query. JdbcRowSet only reflects updates to those rows that are already in the set, and not any newly inserted ones.

Is there a type of RowSet or ResultSet that adds the new rows automatically? Or do I have to re-run the query each time?

Was it helpful?

Solution

Using JDBC, you will have to re-run the query each time. You may be able to achieve what you are looking for by using an ORM, such as Hibernate.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top