On Tue, 5 Jun 2001, Brook, Andy wrote:
> Hi all,
> Im using JDataConnect with struts, all working fine except there are some
> 'custom' properties that the driver supports that I want to set. In this
> instance Unicode support, but it could be anything.
>
> Ive mod'd the necessary code for 'data-source' to reference an
> 'extPropsFile' attribute (eg extPropsFile=myCustomDriver.properties) and
> load it from the root of the webapp classes root, adding properties found
> therein to the properties list built from the other data-source attributes
> and passed onto the driver.
>
> My main reason for going to an external properties file is that there are
> always custom properties that are peculiar to drivers, polluting the
> data-source attributes to support them all is in my view not the way to go.
>
> I can appreciate trying to keep the data-source attribute list as concrete
> as possible is a good thing, but still.....
>
> Any comments on this approach?
>
> If its seen to be useful Ill happily post the changes, its not much code.
>
> TTFN
> andy.
>
> [EMAIL PROTECTED]
> import com.mh.theViewsExpressedHereinAreMyOwnNotThatOfMyCompany;
>
>
>
Andy,
The philosophical idea for data source property initialization is that you
can use the <set-property> element to set arbitrary bean properties by
name. For example, in the struts-config.xml file from the example
application in recent builds, you see something like this:
<data-sources>
<data-source>
<set-property property="autoCommit" value="false"/>
...
<set-property property="maxCount" value="4"/>
...
</data-source>
</data-sources>
The advantage of this approach, of course, is that we don't need to change
the DTD for struts-config.xml in order to add attributes for every
possible data source implementation. Does this meet your requirements, or
are there still additional reasons to need a properties file?
Craig