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 The Flight Captain <ja...@flightcentre.com> on 2009/03/09 09:37:25 UTC

DataImportHandler that uses JNDI lookup

I am using the DataImporterHandler to get database connection details from a
data-config.xml file. I would like to do a JNDI lookup to get database
connection details from a container. So that when I deploy my embedded Solr
Instance I don't have to deploy a data-config.xml for each environment.

After reading the thread linked below, I believe I might be able to
implement a JndiDataSource. I was just wondering if this is the best
approach, and how I would go about using this DataSouce. How can I configure
DataImporterHandler to use a different datasource?

Alternatively do I have to create my own DataImportHandler that uses a JNDI
lookup?

http://www.nabble.com/use-pooled-connections-with-DataImportHandler-tt18706611.html#a18706611

-- 
View this message in context: http://www.nabble.com/DataImportHandler-that-uses-JNDI-lookup-tp22408996p22408996.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: DataImportHandler that uses JNDI lookup

Posted by Noble Paul നോബിള്‍ नोब्ळ् <no...@gmail.com>.
you can overide the init() method of JdbcDataSource say
JndiJdbcDataSource and override the init() method. and use that like
this

<dataSource type="foo.JndiJdbcDataSource"/>"
 ensure that you initialize the field
 private Callable<Connection> factory;

we will have to make this field protected.
can you raise an issue and we shall fix it soon
--Noble


On Mon, Mar 9, 2009 at 2:07 PM, The Flight Captain
<ja...@flightcentre.com> wrote:
>
> I am using the DataImporterHandler to get database connection details from a
> data-config.xml file. I would like to do a JNDI lookup to get database
> connection details from a container. So that when I deploy my embedded Solr
> Instance I don't have to deploy a data-config.xml for each environment.
>
> After reading the thread linked below, I believe I might be able to
> implement a JndiDataSource. I was just wondering if this is the best
> approach, and how I would go about using this DataSouce. How can I configure
> DataImporterHandler to use a different datasource?
>
> Alternatively do I have to create my own DataImportHandler that uses a JNDI
> lookup?
>
> http://www.nabble.com/use-pooled-connections-with-DataImportHandler-tt18706611.html#a18706611
>
> --
> View this message in context: http://www.nabble.com/DataImportHandler-that-uses-JNDI-lookup-tp22408996p22408996.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>



-- 
--Noble Paul