I have created shell script for connection database.
#------------------------------------------------------------------------------------------
# Declaring a variable used in this program
#------------------------------------------------------------------------------------------
Databasename="XYZ"
#------------------------------------------------------------------------------------------
# ************************** MAIN PROGRAM STARTS ******************************************
#------------------------------------------------------------------------------------------
cd $SCRIPT_PATH
db2 connect to $Databasename
touch $UserId $RoleName $MCD_Prod
echo "UserId" > $UserId
echo "RoleName" > $RoleName
db2 -x "Select A.USER_ID from USER A ,ROLE_TYPE R, USER_ROLE U where A.USER_ID=U.USER_ID AND U.ROLE_ID=R.ROLE_ID" >> $UserId
db2 -x "Select R.ROLE_NM from USER A ,ROLE_TYPE R, USER_ROLE U where A.USER_ID=U.USER_ID AND U.ROLE_ID=R.ROLE_ID order by A.USER_ID" >> $RoleName
-------------------------------------------------------------------------------
i have made database validation when i select * in database an connection not found.
But if the database name is incorrrect from "XYZ" to "XYZ1" , database could not connect but program terminate here only..
I need to put validation ..Please help