[logback-dev] svn commit: r1017 - logback/trunk/logback-access/src/main/java/ch/qos/logback/access/db/dialect
noreply.seb at qos.ch
noreply.seb at qos.ch
Tue Nov 28 17:37:17 CET 2006
Author: seb
Date: Tue Nov 28 17:37:16 2006
New Revision: 1017
Added:
logback/trunk/logback-access/src/main/java/ch/qos/logback/access/db/dialect/
logback/trunk/logback-access/src/main/java/ch/qos/logback/access/db/dialect/db2.sql
logback/trunk/logback-access/src/main/java/ch/qos/logback/access/db/dialect/db2l.sql
logback/trunk/logback-access/src/main/java/ch/qos/logback/access/db/dialect/deleteTables.sql
logback/trunk/logback-access/src/main/java/ch/qos/logback/access/db/dialect/mssql.sql
logback/trunk/logback-access/src/main/java/ch/qos/logback/access/db/dialect/mysql.sql
logback/trunk/logback-access/src/main/java/ch/qos/logback/access/db/dialect/oracle.sql
Log:
Added: logback/trunk/logback-access/src/main/java/ch/qos/logback/access/db/dialect/db2.sql
==============================================================================
--- (empty file)
+++ logback/trunk/logback-access/src/main/java/ch/qos/logback/access/db/dialect/db2.sql Tue Nov 28 17:37:16 2006
@@ -0,0 +1,36 @@
+# This SQL script creates the required tables by ch.qos.logback.access.db.DBAppender
+#
+# It is intended for IBM DB2 databases.
+#
+# WARNING WARNING WARNING WARNING
+# =================================
+# This SQL script has not been tested on an actual DB2
+# instance. It may contain errors or even invalid SQL
+# statements.
+
+DROP TABLE access_event_header;
+DROP TABLE access_event;
+
+CREATE TABLE access_event
+ (
+ timestmp BIGINT NOT NULL,
+ requestURI VARCHAR(254),
+ requestURL VARCHAR(254),
+ remoteHost VARCHAR(254),
+ remoteUser VARCHAR(254),
+ remoteAddr VARCHAR(254),
+ protocol VARCHAR(254),
+ method VARCHAR(254),
+ serverName VARCHAR(254),
+ postContent VARCHAR(254),
+ event_id INTEGER GENERATED ALWAYS AS IDENTITY (START WITH 1)
+ );
+
+CREATE TABLE access_event_header
+ (
+ event_id INTEGER NOT NULL,
+ header_key VARCHAR(254) NOT NULL,
+ header_value VARCHAR(1024),
+ PRIMARY KEY(event_id, header_key),
+ FOREIGN KEY (event_id) REFERENCES access_event(event_id)
+ );
Added: logback/trunk/logback-access/src/main/java/ch/qos/logback/access/db/dialect/db2l.sql
==============================================================================
--- (empty file)
+++ logback/trunk/logback-access/src/main/java/ch/qos/logback/access/db/dialect/db2l.sql Tue Nov 28 17:37:16 2006
@@ -0,0 +1,32 @@
+# This SQL script creates the required tables by ch.qos.logback.access.db.DBAppender
+#
+# It is intended for PostgreSQL databases.
+
+DROP TABLE access_event_header;
+DROP TABLE access_event;
+
+CREATE SEQUENCE access_event_id_seq MINVALUE 1 START 1;
+
+CREATE TABLE access_event
+ (
+ timestmp BIGINT NOT NULL,
+ requestURI VARCHAR(254),
+ requestURL VARCHAR(254),
+ remoteHost VARCHAR(254),
+ remoteUser VARCHAR(254),
+ remoteAddr VARCHAR(254),
+ protocol VARCHAR(254),
+ method VARCHAR(254),
+ serverName VARCHAR(254),
+ postContent VARCHAR(254),
+ event_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY
+ );
+
+CREATE TABLE access_event_header
+ (
+ event_id INT NOT NULL,
+ header_key VARCHAR(254) NOT NULL,
+ header_value VARCHAR(1024),
+ PRIMARY KEY(event_id, header_key),
+ FOREIGN KEY (event_id) REFERENCES access_event(event_id)
+ );
\ No newline at end of file
Added: logback/trunk/logback-access/src/main/java/ch/qos/logback/access/db/dialect/deleteTables.sql
==============================================================================
--- (empty file)
+++ logback/trunk/logback-access/src/main/java/ch/qos/logback/access/db/dialect/deleteTables.sql Tue Nov 28 17:37:16 2006
@@ -0,0 +1,3 @@
+
+delete from access_event_property;
+delete from access_event;
Added: logback/trunk/logback-access/src/main/java/ch/qos/logback/access/db/dialect/mssql.sql
==============================================================================
--- (empty file)
+++ logback/trunk/logback-access/src/main/java/ch/qos/logback/access/db/dialect/mssql.sql Tue Nov 28 17:37:16 2006
@@ -0,0 +1,31 @@
+-- This SQL script creates the required tables by ch.qos.logback.access.db.DBAppender
+--
+
+DROP TABLE access_event_header
+DROP TABLE access_event
+
+CREATE TABLE logging_event
+ (
+ timestmp BIGINT NOT NULL,
+ requestURI VARCHAR(254),
+ requestURL VARCHAR(254),
+ remoteHost VARCHAR(254),
+ remoteUser VARCHAR(254),
+ remoteAddr VARCHAR(254),
+ protocol VARCHAR(254),
+ method VARCHAR(254),
+ serverName VARCHAR(254),
+ postContent VARCHAR(254),
+ event_id INT NOT NULL identity,
+ PRIMARY KEY(event_id)
+ )
+
+CREATE TABLE access_event_header
+ (
+ event_id INT NOT NULL,
+ header_key VARCHAR(254) NOT NULL,
+ header_value VARCHAR(1024),
+ PRIMARY KEY(event_id, header_key),
+ FOREIGN KEY (event_id) REFERENCES access_event(event_id)
+ )
+
Added: logback/trunk/logback-access/src/main/java/ch/qos/logback/access/db/dialect/mysql.sql
==============================================================================
--- (empty file)
+++ logback/trunk/logback-access/src/main/java/ch/qos/logback/access/db/dialect/mysql.sql Tue Nov 28 17:37:16 2006
@@ -0,0 +1,38 @@
+# This SQL script creates the required tables by ch.qos.logback.access.db.DBAppender.
+#
+# It is intended for MySQL databases. It has been tested on MySQL 5.0.22 with
+# INNODB tables.
+
+
+BEGIN;
+DROP TABLE IF EXISTS access_event_header;
+DROP TABLE IF EXISTS access_event;
+COMMIT;
+
+BEGIN;
+CREATE TABLE access_event
+ (
+ timestmp BIGINT NOT NULL,
+ requestURI VARCHAR(254),
+ requestURL VARCHAR(254),
+ remoteHost VARCHAR(254),
+ remoteUser VARCHAR(254),
+ remoteAddr VARCHAR(254),
+ protocol VARCHAR(254),
+ method VARCHAR(254),
+ serverName VARCHAR(254),
+ postContent VARCHAR(254),
+ event_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY
+ );
+COMMIT;
+
+BEGIN;
+CREATE TABLE access_event_header
+ (
+ event_id INT NOT NULL,
+ header_key VARCHAR(254) NOT NULL,
+ header_value TEXT,
+ PRIMARY KEY(event_id, header_key),
+ FOREIGN KEY (event_id) REFERENCES access_event(event_id)
+ );
+COMMIT;
\ No newline at end of file
Added: logback/trunk/logback-access/src/main/java/ch/qos/logback/access/db/dialect/oracle.sql
==============================================================================
--- (empty file)
+++ logback/trunk/logback-access/src/main/java/ch/qos/logback/access/db/dialect/oracle.sql Tue Nov 28 17:37:16 2006
@@ -0,0 +1,45 @@
+-- This SQL script creates the required tables by ch.qos.logback.access.db.DBAppender
+--
+-- It is intended for Oracle databases.
+
+
+CREATE SEQUENCE access_event_id_seq MINVALUE 1 START WITH 1;
+
+CREATE TABLE access_event
+ (
+ timestmp BIGINT NOT NULL,
+ requestURI VARCHAR(254),
+ requestURL VARCHAR(254),
+ remoteHost VARCHAR(254),
+ remoteUser VARCHAR(254),
+ remoteAddr VARCHAR(254),
+ protocol VARCHAR(254),
+ method VARCHAR(254),
+ serverName VARCHAR(254),
+ postContent VARCHAR(254),
+ event_id NUMBER(10) PRIMARY KEY
+ );
+
+
+CREATE TRIGGER access_event_id_seq_trig
+ BEFORE INSERT ON access_event
+ FOR EACH ROW
+ BEGIN
+ SELECT access_event_id_seq.NEXTVAL
+ INTO :NEW.event_id
+ FROM DUAL;
+ END access_event_id_seq_trig;
+
+
+CREATE TABLE access_event_header
+ (
+ event_id NUMBER(10) NOT NULL,
+ header_key VARCHAR2(254) NOT NULL,
+ header_value VARCHAR2(1024),
+ PRIMARY KEY(event_id, header_key),
+ FOREIGN KEY (event_id) REFERENCES access_event(event_id)
+ );
+
+
+
+
More information about the logback-dev
mailing list