james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Bagnara <apa...@bago.org>
Subject Re: Accessing JdbcDataSource config in custom service
Date Mon, 01 Oct 2007 07:48:06 GMT
Kevin Jackson ha scritto:
> Hi,
> 
>> Do you need access to the database-connection block or simply you want
>> to manage repositories via the MailRepository interface?
> 
> I want access to the underlying db connection so that I can execute a
> preparedstatement, I don't want to treat the data as mail, just as a
> table

Then take a look at this trunk component:
http://svn.apache.org/repos/asf/james/server/trunk/core-library/src/main/java/org/apache/james/domain/JDBCDomainList.java
http://svn.apache.org/repos/asf/james/server/trunk/core-library/src/main/java/org/apache/james/domain/JDBCDomainList.xinfo

it declares a dependency on the DataSourceSelector and then use it to
make custom queries to a custom table.

Stefano

>> In both cases you have to declare a new dependency in your xinfo file:
>>
>> database-connection:
>> <dependency>
>> <service
>> name="org.apache.avalon.cornerstone.services.datasources.DataSourceSelector"
>> version="1.0" />
>> </depedency>
>>
> 
> Ok, I'll give this a try
> 
> Thanks,
> Kev



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message