data cleanup code and sample code for bigsql connection