TitleModification on JDBCProvider for using container defined DataSources
Date30-Apr-2006 12:53:02 EEST
JSPWiki version2.2.28
Submitter84.168.77.94
Idea CategoryProviderIdea
Reference
Idea StatusNewIdea

Hi,

I made some modification on the JDBCProvider (Wiki Version 2.2.28) It's now possible to use a container defined JDBC DataSource.

I think there are following advantages using a container def. DS:

  • Connection-Pooling is managed by App-Server
  • JDBC specific Data (Driver, User, ....) isn't defined in the Web-Application

I abstract the connection management part. So it's possible to use either the actual JDBC management and the container Data Source management. Please tell me if You are interested.

Btw.: The JDBCProvider supports Oracle too. ( Tested with OracleXE )

Greetings,

Matthias Peter


I made the following changes:

1. I create an interface DataSourceManager.

2. The JDBCBaseProvider and the new class JDBCContainerManaged implement this interface.

3. The AttachmentProvider and PageProvider classes dont extend the JDBCBaseProvider anymore. They have an instance of DataSourceManager so it's possible to use both variants of JDBC connection management.

--MatthiasPeter, 30-Apr-2006


Here are the table definitions for Oracle (they work for me with JDBCProvider for JSPWiki 2.2.28):

CREATE TABLE WIKI_PAGE
    (
        PAGE_NAME          VARCHAR (100)  NOT NULL,
        PAGE_VERSION       INTEGER        NOT NULL,
        PAGE_MODIFIED      DATE,
        PAGE_MODIFIED_BY   VARCHAR (50),
        PAGE_TEXT          LONG VARCHAR,
        PRIMARY KEY (PAGE_NAME)
    );

CREATE INDEX IX_WP_MODIFIED ON WIKI_PAGE_2(PAGE_MODIFIED);

CREATE TABLE WIKI_PAGE_VERSIONS
    (
        VERSION_NAME          VARCHAR (100)  NOT NULL,
        VERSION_NUM           INTEGER        NOT NULL,
        VERSION_MODIFIED      DATE,
        VERSION_MODIFIED_BY   VARCHAR (50),
        VERSION_TEXT          LONG VARCHAR,
        PRIMARY KEY (VERSION_NAME, VERSION_NUM)
    );

CREATE TABLE WIKI_ATT (
  ATT_PAGENAME VARCHAR(100),
  ATT_FILENAME VARCHAR(100),
  ATT_VERSION INTEGER,
  ATT_MODIFIED DATE,
  ATT_MODIFIED_BY VARCHAR(50),
  ATT_DATA BLOB,
  PRIMARY KEY(ATT_PAGENAME, ATT_FILENAME, ATT_VERSION)
);

--Matthias Peter, 18-May-2006


I uploaded a version of the (DS)JDBCProvider port based on JDBCProvider project.

There are 2 new properties for jspwiki.properties:

jspwiki-s.JDBCAttachmentProvider.dsManager = container
jspwiki-s.JDBCAttachmentProvider.dataSource = java:/DefaultDS

Here is a complete definition for using container managed DS:

jspwiki.pageProvider = com.forthgo.jspwiki.jdbcprovider.JDBCPageProvider
jspwiki-s.JDBCPageProvider.dsManager = container
jspwiki-s.JDBCPageProvider.dataSource = java:/DefaultDS

jspwiki.attachmentProvider = com.forthgo.jspwiki.jdbcprovider.JDBCAttachmentProvider
jspwiki-s.JDBCAttachmentProvider.dsManager = container
jspwiki-s.JDBCAttachmentProvider.dataSource = java:/DefaultDS

A documentation about defining a DataSource in Tomcat can be found at the tomcat homepage

--Matthias Peter, 20-May-2006


Hi,

I'm one of the authors of the JDBCProvider, and I have done a lot of rewriting the last few days. It is still not released, but if you get a copy of the dbrewrite branch from SVN (svn checkout http://svn.berlios.de/svnroot/repos/jdbcprovider/dbrewrite). You should be able to roll your own, and if you do an oracle version please let me know. Start by reading the readme.txt file.

Best regards, Søren

--Søren Berg Glasius, 23-Aug-2006

Add new attachment

Only authorized users are allowed to upload new attachments.

List of attachments

Kind Attachment Name Size Version Date Modified Author Change note
zip
DSJDBCProvider-src.zip 18.6 kB 1 20-May-2006 14:17 84.168.52.155
zip
DSJDBCProvider.zip 23.8 kB 1 20-May-2006 14:18 84.168.52.155
« This page (revision-13) was last changed on 23-Aug-2006 16:08 by Søren Berg Glasius