mukesh.lalwani,
With any Korn shell, you can use arrays with a numeric subscript for subscripts from 0 to about 2047. With ksh93 and with bash you can use numeric subscripts with larger values or with string valued subscripts. The syntax is:
$ i=1
$ dbname[1]="tree"
$ echo "${dbname[$i]}"
tree
$
or for multiple array elements:
$ dbname=("forest" "tree")
$ for ((i = 0; i < ${#dbname[@]}; i++))
> do printf 'dbname[%d]="%s"\n' "$i" "${dbname[$i]}"
> done
dbname[0]="forest"
dbname[1]="tree"
$
Or, with any shell based on Bourne shell syntax, you can use eval as shown in the link you referenced. Note that eval can be a security risk if any of the code that you are feeding to eval is supplied by a user. But, eval is generally safe if all of the strings being evaluated by eval are hardcoded into your script.
RTY,
$ echo $dbname$i
prints whatever $dbname expands to followed by whatever $i expands to not to the contents of the variable named by dbname followed by the expansion of $i .