I wants to develop service layer for my application using java. At the same time the service layer can also be exposed to webservice also.
My idea is to create one Generic Abstract Class for database operations , and all other service classes extend that abstract class and do the DB operation through that abstract class methods.
Is this a good idea to do it? Please help me
It's hard to say with so few details, and without even knowing what you'll use to access the database (JDBC? JPA? Hibernate?). But
Also, don't reinvent the wheel. EJB3, Spring and other frameworks have good support to develop services and expose them as web services.
You should consider using some framework, which will help you with routine. E.g. Spring or Java EE. Those frameworks can offer you many built-in solutions like IoC, declarative transactions, declarative security etc.