Java - Oracle Database Change Notification

試著忘記壹切 提交于 2019-12-03 16:58:53

As you guessed you need keep your main thread alive otherwise your program will exit. You can just make it sleep or do something more useful. Also you can close the JDBC connection but you don't want to close (unregister) the registration immediately. The way Database Change Notification works is with an internal listening thread that runs within the driver. This listening thread will receive outband events sent by the server through a dedicated network socket, process these events and notify the listeners. This listening thread will be closed if you unregister. When you're no longer interested in receiving these events you can create another connection to the database to unregister which will end up closing the driver's listening thread.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!