Database accessing sample codes for OOP