On Wed, 2002-09-25 at 09:18, Pierre van Rooden wrote:
> > bugfix #2813, with fallback code to resolve the database-type from the connection.
> Can you update the bugfix with a description of what you fixed?
Well, guess that you didnt know what the database-type was of the
connection, why else try to resolve it in a fallback routine ;) Next
time i shall be more informative, but lately i also heard some sounds
that sometimes my checkin's contained to much deltailed information.
> And I'm not sure if checking on a JDBC class name when the databsename
> is not given is appropriate - I would prefer throwing an exception when
> the databasename is not given, OR the system could search the 'known'
> databases (xml config files) for the classname.
You cannot determine the database from the xml config file's.
I agree that it is not a -elegant- sollution, but i think we should look
at this detection, and imho using jdbc information(below) would be much
better than specifying the database-type inside the mmbaseroot.xml. The
reason for this is that you can test if a version of the database is
supported.
The following information should be asked from the connection.
Connection.getMetaData().
getDatabaseProductName()
getDatabaseProductVersion()
getDriverMajorVersion()
getDriverMinorVersion()
getDriverName()
getDriverVersion()
In an xml there should be filters for database. In such a filter there
is the possibility so set value's for each field. Not specifiying would
be the same as matching. A search from the top would then start and pick
the first matching implementation for this connection.
<filters>
<filter type="mysql">
<database-product-name>mysql</database-product-name>
</filter>
<filter type="postgresql71">
<database-product-name>postgresql</database-product-name>
<database-product-version>7.1</database-product-version>
</filter>
<filter type="postgresql">
database-product-name>postgresql</database-product-name?
</filter>
<!-- catch all the connections, that are not handled by other
filters -->
<filter type="sql92" />
</filters>
--
Eduard Witteveen Systeem Ontwikkelaar
Publieke Omroep, Gateway C Kamer 101
+31(0)356772910 http://www.omroep.nl/
Sed quis custodiet ipsos custodes? : The sixth Satire from Juvenal