I am writing some flow services that will read and update data in a set of databases. Each database has the same schema, and the logic to invoke against each database is the same. Instead of writing flow services that are tied to a specific adapter, and therefore having to clone these flow services for each database, I would prefer to have a single flow service that reads/updates the database, but decides which database to connect to based on the input data.
My goal here is to minimize the amount of cloned code that I have to maintain.
My thought is to have a java flow service that will obtain a JDBC connection from the JDBC adapter at the beginning of processing, then perform the necessary reads and updates to the database using the JDBC methods/classes.
I’ve done something similar before, but in that case I used some third-party open source classes to manage the JDBC connection pools. In this case I would prefer to have the webMethods JDBC adapter manage the connection pool for each database. I just need to be able to obtain a connection from the pool at the beginning of processing (and of course return it when I am finished).
Is this possible? Or does anyone have alternative suggestions on how I can minimize the amount of cloned code?