-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I think you should have the table creation statements in an xml file,
and read them from this as directed by config.xml

so for example...

config.xml snippet might read:

      <spoolRepository>
        <repository
destinationURL="jdbc:mysql://www.x.co.uk/mailusers?user=James&password
=mailhost"
                    type="USERS"
                    model="SYNCHRONOUS">
                <driver>org.gjt.mm.mysql.Driver</driver>
                <tablename>mailusers</tablename>
                <SQL>
                        <create>rdbms.Mysql.users.create</create>
                        <queries>rdbms.Mysql.users.queries</queries>
                </SQL>
        </repository>
      </spoolRepository>


Then... the SQL.XML would be..

<James-JDBC-repository-SQL-Store>
        <rdbms>
                <Mysql>
                        <users>
                                <create>
                                    CREATE TABLE [tablename] (
                                         id INT NOT NULL AUTO_INCREMENT,
                                         firstnamefield VARCHAR(60) NOT NULL,
                                         lastnamefield VARCHAR(60) NOT NULL,
                                         PRIMARY KEY (id)
                                         );
                                </create>
                                <queries>
                                <insert>INSERT into [tablename] (firstnamefield, 
lastnamefield)
values ('[firstname]','[lastname]')
                        ...more-queries-here...
                                </queries>
                        </users>
                </Mysql>
        </rdbms>
</James-JDBC-repository-SQL-Store>

where.. [tablename],[firstname],[lastname] are replaced at runtime by
james with appropriate values .. 
thus to add support for any other SQL RDBMS would only require a JDBC
driver and some time hacking the SQL config file, no hacking the
code.




> -----Original Message-----
> From: Christian Trutz [mailto:[EMAIL PROTECTED]]

> 
> I think we need different UsersXXXrepository (XXX=MySQL,
> M$SQLServer) because this different DBS habe different SQL
> dialects:

> so, if James should create tables, we need to save the above SQL
> statements somewhere ... another idea is to save the above SQL
> statements into configuration file or another idea is to assume the
> tables are not created by James.
 

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBOyDnaUlGf1KbtpBnEQK1hgCg+ie7JaCaWS6PXYmPf0gSqyVG8WcAoKu2
DMVM4KL+pwzZ4wKBKtsi5z0i
=aL6N
-----END PGP SIGNATURE-----


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to