# JDBC River : sipmle strategy, polling & data updates

**URL:** <https://discuss.elastic.co/t/jdbc-river-sipmle-strategy-polling-data-updates/10839>\
**Category:** Elasticsearch\
**Created:** [February 21, 2013, 1:49pm UTC](https://discuss.elastic.co/t/jdbc-river-sipmle-strategy-polling-data-updates/10839 "2013-02-21T13:49:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yann\_Barraud](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yann_barraud/32/1108_2.png) [@Yann\_Barraud](https://discuss.elastic.co/u/Yann_Barraud)\
**Post date:** [February 21, 2013, 1:49pm UTC](https://discuss.elastic.co/t/jdbc-river-sipmle-strategy-polling-data-updates/10839/1 "2013-02-21T13:49:34Z")

</div>

Hi,

I'm using JDBC River to request structured objects in an Oracle DB. the  
point is when the first poll is over, data keeps being inserted at each  
round.

I use a request with a join on 3 tables.

curl -XPUT 'localhost:9200/\_river/my\_eip\_river/\_meta' -d '{  
"type" : "jdbc",  
"jdbc" : {  
"driver" : "oracle.jdbc.driver.OracleDriver",  
"url" : "jdbc:oracle:thin:@10.xxx.xxx.xxx:1521/xxxx",  
"strategy" : "simple",  
"poll" : "5m",  
"user" : "WM\_SB92\_5510\_ADMIN",  
"password" : "wmeip2012",  
"sql" : "SELECT a from table\_a, b from table\_b, c from table\_c  
where a.di =b.id and b.id = c.id"  
},  
"index" : {  
"index" : "jdbc",  
"type" : "jdbc"  
}  
}'

What do I miss ?

Thanks.  
Regards,  
Yann

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [February 26, 2013, 12:08am UTC](https://discuss.elastic.co/t/jdbc-river-sipmle-strategy-polling-data-updates/10839/2 "2013-02-26T00:08:53Z")

</div>

In the select statement, you should address a column to '\_id' to set a  
constant ES \_id for object reference. Otherwise, ES creates a random id  
for you, and rows will get inserted as documents each poll again and again.

Best regards,

Jörg

Am 21.02.13 14:49, schrieb Yann Barraud:

> Hi,
> 
> I'm using JDBC River to request structured objects in an Oracle DB.  
> the point is when the first poll is over, data keeps being inserted at  
> each round.
> 
> I use a request with a join on 3 tables.
> 
> curl -XPUT 'localhost:9200/\_river/my\_eip\_river/\_meta' -d '{  
> "type" : "jdbc",  
> "jdbc" : {  
> "driver" : "oracle.jdbc.driver.OracleDriver",  
> "url" : "jdbc:oracle:thin:@10.xxx.xxx.xxx:1521/xxxx",  
> "strategy" : "simple",  
> "poll" : "5m",  
> "user" : "WM\_SB92\_5510\_ADMIN",  
> "password" : "wmeip2012",  
> "sql" : "SELECT a from table\_a, b from table\_b, c from table\_c  
> where a.di =b.id and b.id = c.id"  
> },  
> "index" : {  
> "index" : "jdbc",  
> "type" : "jdbc"  
> }  
> }'
> 
> What do I miss ?
> 
> ## Thanks. Regards, Yann
> 
> You received this message because you are subscribed to the Google  
> Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send  
> an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![lyndon\_camson](https://avatars.discourse-cdn.com/v4/letter/l/85e7bf/32.png) [@lyndon\_camson](https://discuss.elastic.co/u/lyndon_camson)\
**Post date:** [March 20, 2013, 1:48am UTC](https://discuss.elastic.co/t/jdbc-river-sipmle-strategy-polling-data-updates/10839/3 "2013-03-20T01:48:12Z")

</div>

Hi,

Sorry to have still replied to this.

I have this users table with id, fname, lname and update\_date.

I am using this statement

"SELECT \*, id AS \_id, CONCAT(fname, ' ', lname) AS member\_name FROM users  
WHERE (create\_date BETWEEN DATE\_SUB(NOW(), INTERVAL 1 HOUR) AND NOW()) OR  
(update\_date BETWEEN DATE\_SUB(NOW(), INTERVAL 1 HOUR) AND NOW())"

and using strategy =\> simple, poll =\> 5s

when I update a row, say the fname. fname before was "George" then I update  
it to "Will", it's not updated. Am I missing something here? I have already  
set an \_id field.

On Tuesday, February 26, 2013 8:08:53 AM UTC+8, Jörg Prante wrote:

> In the select statement, you should address a column to '\_id' to set a  
> constant ES \_id for object reference. Otherwise, ES creates a random id  
> for you, and rows will get inserted as documents each poll again and  
> again.
> 
> Best regards,
> 
> J?rg
> 
> Am 21.02.13 14:49, schrieb Yann Barraud:
> 
> > Hi,
> > 
> > I'm using JDBC River to request structured objects in an Oracle DB.  
> > the point is when the first poll is over, data keeps being inserted at  
> > each round.
> > 
> > I use a request with a join on 3 tables.
> > 
> > curl -XPUT 'localhost:9200/\_river/my\_eip\_river/\_meta' -d '{  
> > "type" : "jdbc",  
> > "jdbc" : {  
> > "driver" : "oracle.jdbc.driver.OracleDriver",  
> > "url" : "jdbc:oracle:thin:@10.xxx.xxx.xxx:1521/xxxx",  
> > "strategy" : "simple",  
> > "poll" : "5m",  
> > "user" : "WM\_SB92\_5510\_ADMIN",  
> > "password" : "wmeip2012",  
> > "sql" : "SELECT a from table\_a, b from table\_b, c from table\_c  
> > where a.di =b.id and b.id = c.id"  
> > },  
> > "index" : {  
> > "index" : "jdbc",  
> > "type" : "jdbc"  
> > }  
> > }'
> > 
> > What do I miss ?
> > 
> > ## Thanks. Regards, Yann
> > 
> > You received this message because you are subscribed to the Google  
> > Groups "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send  
> > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:45am UTC](https://discuss.elastic.co/t/jdbc-river-sipmle-strategy-polling-data-updates/10839/4 "2017-07-06T02:45:40Z")

</div>


