0

I'm a beginner in Java projects and I want to know the best way to do something. I have developed a desktop application which show data from a table in database in a JTable, and when that table has a change, it has to show previous data + new records.

Well, I made a thread: First of all, Start, show all the data in a JTable, executing a query. Thread: keep attention to database, executing a query, different from the first one, every X seconds.

It's supposed that every single connection after executing query is closed, but from time to time appears this error:

Listener refused the connection with the following error: ORA-12519, TNS:no appropriate service handler found

I've read something about it exceeded the maximum number of proccesses admitted, and also probably I could solve it with Poolable Connection, but I'm not sure about how to do it. Could anyone help me with that?

Thanks in advance!

Sophie_
  • 36
  • 3

2 Answers2

0

I am not sure about oracle, but I tried a similar approach using the MS Access Database. Instead of a thread, I used the Timer and the TimerTask class to schedule my process to repeat after a fixed rate. There is a scheduleAtFixedRate method in the Timer class which helps you to schedule tasks in the thread pool. I think that should help. Look at the api for these classes for more information. http://docs.oracle.com/javase/7/docs/api/java/util/Timer.html http://docs.oracle.com/javase/7/docs/api/java/util/TimerTask.html

Anmol Mahatpurkar
  • 541
  • 1
  • 4
  • 13