It is easy to include variables in xml file to assign jdbc username and password. Can one assign repository configuration through xml file.
Indeed, you can. See, for example, Database persistence problems with Oracle and MySQL.