Query Transformation for Accessing Heterogeneous Databases