using datasource for creating sql instead of connection.