Hello,
I've a
Java service in which I listen to incoming IBM MQ messages on a configured channel/queue. I've four type of messages,based on the business logic. For each of these types, there is mapping of MS Sql database connection
string maintained in a config table(say T) in another database.
So, for every message receieved, depending upon the type of message received:
I the retrieve the corresponding database connectionn string from this table T above.
Connect to the db and execute a stored proc(MySP), using the following code:
My question here is: Is this approach of dynamically connecting to db a correct way in Java w.r.t. performance/memory usage, especially when the volume of messages is large enough causing a lot of opening and closing db operations? Or there is a better way to do this in Java?