You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Dragomir Milivojevic <dr...@milivojevic.net> on 2002/08/13 16:50:12 UTC

Another database support

Hi,

I'm using Sybase 11.0.3 database, which Sybase gave to Linux community for free development and deployment. I thought to share my database setup with you (should you want to add it to cfg file)

I started with mssql setup (since it is essentially sybase), removed "["'s and fixed some record sizes. Syb doesn't support indexes larger then 255 hence message_name & repository_name change ... why were they so large anyway i wander ... 

    <sql name="createTable" db="mssql">
        CREATE TABLE ${table} (
                message_name varchar (120) NOT NULL,
                repository_name varchar (120) NOT NULL,
                message_state varchar (30) NOT NULL ,
                error_message varchar (255) NULL ,
                sender varchar (200) NULL ,
                recipients text NOT NULL ,
                remote_host varchar (100) NOT NULL ,
                remote_addr varchar (20) NOT NULL ,
                message_body image NOT NULL ,
                last_updated datetime NOT NULL
        )
                ALTER TABLE ${table}  ADD
                        CONSTRAINT PK_${table} PRIMARY KEY
                        (
                                message_name,
                                repository_name
                        )

    </sql>

One more change is required

<sql name="createTable" db="mssql">CREATE TABLE ${table} (uniqueId UNIQUEIDE
NTIFIER, username VARCHAR(50) NOT NULL, pwdHash VARCHAR(50), pwdAlgorithm VARCHA
R(20), useForwarding SMALLINT, forwardDestination VARCHAR(250) NULL, useAlias SM
ALLINT, alias VARCHAR(250), PRIMARY KEY(username))</sql>


forwardDestination has to be NULL because when user is created it puts NULL there ... whether it should be so or I just "fixed" it, that remains the question. However explicit declarations are good things when trying to support different databases that can default to NULL or NOT NULL arbitrarily.

and that should do it ...

-d-

RE: Another database support

Posted by "Noel J. Bergman" <no...@devtech.com>.
Dagomir,

Would you please take the CVS copy of sqlResources.xml, add sybase according
to the pattern, and submit the diff file?

You'll end up with sections like:

  <sql name="createTable" db="sybase">

	--- Noel

-----Original Message-----
From: Dragomir Milivojevic [mailto:dragomir@milivojevic.net]
Sent: Tuesday, August 13, 2002 10:50
To: james-dev@jakarta.apache.org
Subject: Another database support


Hi,

I'm using Sybase 11.0.3 database, which Sybase gave to Linux community for
free development and deployment. I thought to share my database setup with
you (should you want to add it to cfg file)

I started with mssql setup (since it is essentially sybase), removed "["'s
and fixed some record sizes. Syb doesn't support indexes larger then 255
hence message_name & repository_name change ... why were they so large
anyway i wander ...

    <sql name="createTable" db="mssql">
        CREATE TABLE ${table} (
                message_name varchar (120) NOT NULL,
                repository_name varchar (120) NOT NULL,
                message_state varchar (30) NOT NULL ,
                error_message varchar (255) NULL ,
                sender varchar (200) NULL ,
                recipients text NOT NULL ,
                remote_host varchar (100) NOT NULL ,
                remote_addr varchar (20) NOT NULL ,
                message_body image NOT NULL ,
                last_updated datetime NOT NULL
        )
                ALTER TABLE ${table}  ADD
                        CONSTRAINT PK_${table} PRIMARY KEY
                        (
                                message_name,
                                repository_name
                        )

    </sql>

One more change is required

<sql name="createTable" db="mssql">CREATE TABLE ${table} (uniqueId UNIQUEIDE
NTIFIER, username VARCHAR(50) NOT NULL, pwdHash VARCHAR(50), pwdAlgorithm
VARCHA
R(20), useForwarding SMALLINT, forwardDestination VARCHAR(250) NULL,
useAlias SM
ALLINT, alias VARCHAR(250), PRIMARY KEY(username))</sql>


forwardDestination has to be NULL because when user is created it puts NULL
there ... whether it should be so or I just "fixed" it, that remains the
question. However explicit declarations are good things when trying to
support different databases that can default to NULL or NOT NULL
arbitrarily.

and that should do it ...

-d-


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>