Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to refresh the output in DOS console?

 
pengpeng lin
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have a trouble with some UI output.Here is the requirement below:

1.The program will use the DOS as UI.

2.The program will execute some important job with a background thead,alos
it must provide the monitor function by displaying some information about
the transaction every several minutes.

For example:

There are *** records in souce database
There are *** records have been inserted to the destination database
There are *** records have been failed to insert to the destination
There are *** records remain in source database

All the inforamtion above must be refreshed in every 5 minutes.

So far as I know, I could use thread to get the real information from some other class,but the most troublesome job is that :

How can I refresh the information, not "append" ! just refresh the output!

Can anyone help me!

Thanks very much!
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could use Ansi.sys, to move 5 lines up after printing the last:
http://academic.evergreen.edu/projects/biophysics/technotes/program/ansi_esc.htm
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic