shell script to pass values properties file in java
You can obtain old parameters from the properties file before using sed, e.g.

# get old parameters
$ export oldUsername=$(grep mysql.username $FILE | cut -d'=' -f2)
$ export oldPass=$(grep mysql.pass $FILE | cut -d'=' -f2)

# set new parameters
$ export newUsername=NEW_USERNAME
$ export newPass=NEW_PASS

# change parameters
$ sed -i "s/$oldUsername/$newUsername/g" $FILE
$ sed -i "s/$oldPass/$newPass/g" $FILE