Devam Ediyor

Counter servlet

A simple counter servlet

Technology : Implemented in Java/Tomcat (V5)

Result : a war file

A simple servlet which use a pool of connection (parameters defined in servlet initialization context)

Read parameters :

String id = [url removed, login to view]("i");

String oper = [url removed, login to view]("o");

String host = [url removed, login to view]("h");

String res = [url removed, login to view]("r");

redirect the url (trace log in logger [specific logger by oper]):

if ([url removed, login to view]("http://")) url = res;

else url = "http://" + host + "/res/" + res;

[url removed, login to view]("redirect id: " + id + " oper " + oper + " url " + url);

[url removed, login to view](url); // when here no error return

then add a counter

String values = "'', '" + id + "', '" + res + "', '" + new Date() + "'"; // first value is auto-incremented ky

String sql = "INSERT INTO `" + oper + "` VALUES(" + values + ")";

log error et create database if not already existing (1 database per oper)

CREATE TABLE [url removed, login to view] (

`key` int( 4 ) NOT NULL AUTO_INCREMENT ,

`id` varchar( 20 ) NOT NULL default '',

`res` varchar( 50 ) NOT NULL default '',

`date` date NOT NULL default '0000-00-00',

PRIMARY KEY ( `key` )

) TYPE = MYISAM ;

Where project name is defined from another table form the oper value.

All catching exception and alert should be taken in account.

Beceriler: Java

Daha fazlasını görün: pool host, per h, int i, auto alert, sql r, r sql, v5, trace, tomcat, servlet, primary, null, ky, key logger, key account, int, insert date, counter, context , simple java sql project, auto pending request, connection pool, implemented, error connection database, auto log

İşveren Hakkında:
( 4 değerlendirme ) OULLINS, France

Proje NO: #32252