Fix for Issue #22 : flag should be replaced with proper name.

Replaced flag with ret_val in all function with database conectivity.

Signed-off-by: Ashish Namdev <ashish28.sirt@gmail.com>