You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by con <co...@gmail.com> on 2009/01/18 17:37:45 UTC

Reading database parameters from outside data-config.xml

Hi all
Currently i am defining database parameters like the url, username and
password and also the query in data-config.xml.
How can I change this scenario by which the query still remains in the
data-config.xml and all other DB details from a different file[Not in
solrconfig.xml]. This is because of security reasons and also i have
multiple DBs but same tables. So the query remains same but parameters
changes.

Waiting for a positive suggestion
Thanks
Con 
-- 
View this message in context: http://www.nabble.com/Reading-database-parameters-from-outside-data-config.xml-tp21529799p21529799.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Reading database parameters from outside data-config.xml

Posted by Jon Baer <jo...@gmail.com>.
I think DIH would have to support JNDI which it current does not (I  
think).  Id also be interested in this (or where the credentials came  
from the db itself).

- Jon

On Jan 18, 2009, at 11:37 AM, con wrote:

>
> Hi all
> Currently i am defining database parameters like the url, username and
> password and also the query in data-config.xml.
> How can I change this scenario by which the query still remains in the
> data-config.xml and all other DB details from a different file[Not in
> solrconfig.xml]. This is because of security reasons and also i have
> multiple DBs but same tables. So the query remains same but parameters
> changes.
>
> Waiting for a positive suggestion
> Thanks
> Con
> -- 
> View this message in context: http://www.nabble.com/Reading-database-parameters-from-outside-data-config.xml-tp21529799p21529799.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>


Re: Reading database parameters from outside data-config.xml

Posted by Noble Paul നോബിള്‍ नोब्ळ् <no...@gmail.com>.
Unfortunately , there is no inbuilt feature which supports something
like this. The problem is that there is no simple common way to
achieve this. some would want JNDI, some would want a properties file
and some would want it to be read from ldap/jdbc etc


It is possible to use a different DataSource say MyJdbcDataSource
extends JdbcDataSource an you an override the init() method and use
MyJdbcdataSooyrce as the 'type' in the <dataSource> tag.

probably you can make this generic by adding a 'properties' attribute
(the value can be a file name) to the existing JdbcDataSource



On Sun, Jan 18, 2009 at 10:07 PM, con <co...@gmail.com> wrote:
>
> Hi all
> Currently i am defining database parameters like the url, username and
> password and also the query in data-config.xml.
> How can I change this scenario by which the query still remains in the
> data-config.xml and all other DB details from a different file[Not in
> solrconfig.xml]. This is because of security reasons and also i have
> multiple DBs but same tables. So the query remains same but parameters
> changes.
>
> Waiting for a positive suggestion
> Thanks
> Con
> --
> View this message in context: http://www.nabble.com/Reading-database-parameters-from-outside-data-config.xml-tp21529799p21529799.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>



-- 
--Noble Paul