Yes we can.For example you have a table customer make a class Customer and fire query in DB and initialize data member of Customer class with the result of query witch fetch the customer info from db and use Customer class likeString name=Customer.name;