This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
You can use simple variable to fetch count from database & again increment this count if hit ocurs for certain page & persist/update this into database.
In second method you can use variable with application scope to hold count of the visits to certain page in your application. But drawback of this method is that it will hold count only untill your server is alive/running. Once you restart your server the "application" variable gets reset. So you need to implement some method to persist this variable in regular inerval of time into database.