| A JavaBean that configures an entry in OJB's ConnectionRepository
according to its properties. If a JCD alias is not specified, it defaults
to the bean's name in the Spring configuration. If the JDBC connection
descriptor already exists (e.g. because it has been defined in OJB's
configuration) the properties are merged into the existing descriptor
(see note about "platform" below), else the JDBC connection descriptor
is created.
If a JNDI name is set, the bean automatically configures a JDBC connection
descriptor with a connection factory of type
ConnectionFactoryManagedImpl , else it uses
ConectionFactoryDBCPImpl . This may be overridden my setting
the connection factory property explicitly.
Properties "driverClassName", "url", "username" and "password" are used
only if no JNDI name is set, i.e. if the connection factory uses the
driver to create data sources.
The bean derives the RDBMS platform setting from the configured
data source or database driver using OJB's JdbcMetadataUtils
class. At least until OJB 1.0.3, however, this class does not properly
distinguish the platforms "Oracle" and "Oracle9i"; it always assigns
"Oracle". In case of "Oracle", this bean therefore opens a connection,
obtains the version information from the database server and adjusts the
platform accordingly. This behaviour may be overridden by setting the
platform property of the bean explicitly. Note that the
attribute "platform" of an already existing JCD is ignored. An already
existing JCD stems most likely from a configuration file "repository.xml".
As the DTD for "repository.xml" ("repository.dtd") defines a default
value for attribute "platform" ("Hsqldb"), it is in general impossible
to find out whether the platform attribute of an existing JCD has been set
explicitly or has simply assumed its default value.
author: Michael Lipp version: $Id$ |