Hello, young man!
It is recommended that you create a Database Connections Factory, a Data Access Object (DAO) to manipulate the access and acquisition of the information to the bank, and finally, one that allows you to validate whether the information is valid or not .
In this way you will be able to maintain a high cohesion a low coupling.
See, at the top layer, what I will call Validator, you receive your object with user properties such as login and password.
In this validator you request the information for the bank through DAO - which I would recommend injecting - and then approve whether the values are consistent or not.
In DAO you check which bank you should access, and then call your factory. This can be by reading some system property, reading some external file, or even just requesting another class.
Following this idea, if you have any problem in the validation, you only change in the Validator; if you have problems with the query, change in DAO; Finally, if it is a problem in creating the connection, change in the factory.
Any questions, just talk!
Greetings
Edited
Here you can find an example:
Example