Using DB alias in custom java to connect to DataBase

Hi all,
my situation requires that I write custom java code (JDBC 2.0) to do a batch update to DB2 database. we already have created DB aliases and I would like to use that information to connect to a database using JDBC calls. Can anyone let me know how to use url, username, password information from an alais? are there any API calls involved or do I have to use the jdbc.cnf file? I don’t know how to get password information from that jdbc.cnf file.

Thanks in advance,

You can invoke the service wm.server.db:dataSourceGet to get the information about the alias.

Hi Rupinder,
Thanks a lot. that solves my problem.