The diffusion of service oriented architectures is slowed down by the lack of enough services available for satisfying service integrator needs. Nevertheless, many features desired by service integrators have already been implemented in existing software systems. To this aim, approaches able to identify potential services into a legacy system source code are highly desirable. This paper proposes an approach to identify, from database–oriented applications, pieces of functionality to be potentially exported as services. The identification is performed by clustering, through formal concept analysis, queries dynamically extracted by observing interactions between the application and the database. The approach has been assessed by identifying potential services in two Java software systems.