added codes for supporting mysql db