I would give myBatis a good look. It handles all the pain associated with JDBC, as well as transactions and matching results with Java objects or hashes.
It also works well with SQL and stored procedure, separating them from Java code and customizing them in XML configuration files. This works much better in practice, because itβs easier to copy queries from XML to an interactive SQL browser and vice versa.
To connect to multiple datasets, you need to create an SqlSessionFactory for each data source.
source share