How can a servlet refresh automatically if some new data has entered the database?

You also have to figure out how to ask the database if something changed, on the servlet-side. You're on your own for that :-) See the JDBC FAQ for help. You probably have to spawn a thread that periodically does an SQL query.

Advertiser Disclosure:
Some of the products that appear on this site are from companies from which QuinStreet receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. QuinStreet does not include all companies or all types of products available in the marketplace.