JSP Hit Counter Free Open Code
| Published on 4/6/2007 by editor More articles in JSP
|
This counter uses MS SQL Server to store hits. I have used a custom stored procedure to add and display hit. This is a very good example using stored procedures with JSP.
You may use this script only with MS SQL. First you should create a table and a procedure. You may use Query Manager.
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[counter]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
CREATE TABLE [dbo].[counter] (
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[webcounter]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
SET QUOTED_IDENTIFIER OFF
CREATE PROCEDURE dbo.webcounter
Now you can create our script. You may put this code anywhere you want to display the counter :
<%@ page import="java.sql.*" %>
Statement stmtt = ocon.createStatement();
|
no comments submitted



