List Out All Coldfusion Data Sources Along with Username and Password

Using ColdFusion service Factory we can take all details of data sources, database, username, class, map details (database role), driver.The following code can be used to list out data sources along with username and decrypted passwords. I hope it may be useful to you.

<cfset objDS = createobject("java","coldfusion.server.ServiceFactory")
.getDatasourceService().getDatasources() />
<table border="1" cellpadding="3" cellspacing="0" width="50%">
<cfloop collection="#objDS#" item="Key">
<cfif len(objDS[Key]["password"])>
<cfset password = Decrypt(objDS[Key]["password"],generate3DesKey("0yJ!@1$r8p0L@r1$6yJ!@1rj"), "DESede","Base64") />