Weird. I can make it work with a request parameter and 
$dataimporter.request.dbhost:

http://localhost:8983/solr/textbooks/dataimport?command=full-import&dbhost=mydbhost

Or I can make it work with a Java system property with no dots.

But when I use a Java system property with internal dots, it doesn't work.

wunder

On Jan 20, 2012, at 3:53 PM, Walter Underwood wrote:

> On Jan 20, 2012, at 3:34 PM, Shawn Heisey wrote:
> 
>> On 1/20/2012 3:48 PM, Walter Underwood wrote:
>>> Is there a way to parameterize the JDBC URL in the data import handler?  I 
>>> tried this, but it did not insert the value of the property. I'm running 
>>> Solr 3.3.0.
>>> 
>>>  <dataSource driver="com.mysql.jdbc.Driver"
>>>           url="jdbc:mysql://${com.chegg.dbhost}/product"
>> 
>> Here's what I've got in mine.  I pass in dbHost and dbSchema parameters 
>> (along with a bunch of others that get used in the entity SQL statements) 
>> when starting DIH.
>> 
>> url="jdbc:mysql://${dataimporter.request.dbHost}:3306/${dataimporter.request.dbSchema}?zeroDateTimeBehavior=convertToNull"
> 
> 
> Are those Java system properties? I didn't get a substitution when I ran: 
> java -Dcom.chegg.dbhost=mydbhost
> 
> The resulting JDBC URL was jdbc:mysql:///product, so it replaced the variable 
> with empty string. Odd.
> 
> wunder
> --
> Walter Underwood
> wun...@wunderwood.org




Reply via email to