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/05/05 12:02:20 UTC

Externalize database parameters from data-config.xml

I have a spring-ibatis project running in my development environment.
Now i am setting solr search as part of the application. Everything works
fine as expected and solr is providing good results.

The only problem i am having is that i have to set the database parameters
including the username and password in the data-config.xml.
Two drawbacks in this aproach is that 
	1) the db parameters are been exposed to outside
	2) dynamically loading the database params on demand (as i have multiple
databases)
I think this can be solved by using the db configurations that is defined in
the spring configs.

Is there anyway to achieve this. Or atleast can i externalise these
parameters from the data-config.xml, so that i can encrypt the password.

Thanks
con
-- 
View this message in context: http://www.nabble.com/Externalize-database-parameters-from-data-config.xml-tp23384483p23384483.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Externalize database parameters from data-config.xml

Posted by Noble Paul നോബിള്‍ नोब्ळ् <no...@corp.aol.com>.
There are two options.

1) pass on the user name and password as request parameters and use
the request parameters in the datasource

<dataSource user="x" password="${dataimporter.request.pwd}" />
where pwd is a request parameter passed

2) if you can create jndi datasources in the appserver use the
jndiName attribute in dataSource



On Tue, May 5, 2009 at 3:32 PM, con <co...@gmail.com> wrote:
>
> I have a spring-ibatis project running in my development environment.
> Now i am setting solr search as part of the application. Everything works
> fine as expected and solr is providing good results.
>
> The only problem i am having is that i have to set the database parameters
> including the username and password in the data-config.xml.
> Two drawbacks in this aproach is that
>        1) the db parameters are been exposed to outside
>        2) dynamically loading the database params on demand (as i have multiple
> databases)
> I think this can be solved by using the db configurations that is defined in
> the spring configs.
>
> Is there anyway to achieve this. Or atleast can i externalise these
> parameters from the data-config.xml, so that i can encrypt the password.
>
> Thanks
> con
> --
> View this message in context: http://www.nabble.com/Externalize-database-parameters-from-data-config.xml-tp23384483p23384483.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>



-- 
-----------------------------------------------------
Noble Paul | Principal Engineer| AOL | http://aol.com

Re: Externalize database parameters from data-config.xml

Posted by Michael Ludwig <ml...@as-guides.com>.
con schrieb:

> The only problem i am having is that i have to set the database
> parameters including the username and password in the data-config.xml.

> I think this can be solved by using the db configurations that is
> defined in the spring configs.

> can i externalise these parameters from the data-config.xml, so that i
> can encrypt the password.

A JNDI DataSource is probably the best solution, but if the relevant
part of your spring configuration in XML, then there is also the XML way
of sharing by using an external entity, like this:

milu@lobster:~/funkuhr > cat eins.xml
<!DOCTYPE Eins [
<!ENTITY cred SYSTEM "cred.ent" >
]>
<Eins> &cred; </Eins>

milu@lobster:~/funkuhr > cat zwei.xml
<!DOCTYPE Zwei [
<!ENTITY cred SYSTEM "cred.ent" >
]>
<Zwei> &cred; </Zwei>

milu@lobster:~/funkuhr > cat cred.ent
<User>ich</User>
<Password>geheim</Password>

milu@lobster:~/funkuhr > xmllint --noent eins.xml
<?xml version="1.0"?>
<!DOCTYPE Eins [
<!ENTITY cred SYSTEM "cred.ent">
]>
<Eins> <User>ich</User>
<Password>geheim</Password>
  </Eins>

milu@lobster:~/funkuhr > xmllint --noent zwei.xml
<?xml version="1.0"?>
<!DOCTYPE Zwei [
<!ENTITY cred SYSTEM "cred.ent">
]>
<Zwei> <User>ich</User>
<Password>geheim</Password>
  </Zwei>

But that doesn't address the encryption issue.

Michael Ludwig

Re: Externalize database parameters from data-config.xml

Posted by Avlesh Singh <av...@gmail.com>.
If Solr is a "part" of your application, then why not have tokens in your
data-config.xml as place holders for db username, password etc which can be
replaced with the actual values as a part of your project build/deploy task.

Cheers
Avlesh

On Tue, May 5, 2009 at 3:32 PM, con <co...@gmail.com> wrote:

>
> I have a spring-ibatis project running in my development environment.
> Now i am setting solr search as part of the application. Everything works
> fine as expected and solr is providing good results.
>
> The only problem i am having is that i have to set the database parameters
> including the username and password in the data-config.xml.
> Two drawbacks in this aproach is that
>        1) the db parameters are been exposed to outside
>        2) dynamically loading the database params on demand (as i have
> multiple
> databases)
> I think this can be solved by using the db configurations that is defined
> in
> the spring configs.
>
> Is there anyway to achieve this. Or atleast can i externalise these
> parameters from the data-config.xml, so that i can encrypt the password.
>
> Thanks
> con
> --
> View this message in context:
> http://www.nabble.com/Externalize-database-parameters-from-data-config.xml-tp23384483p23384483.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>