Re[2]: DataStream, Sink and JDBC

2016-03-07 Thread toletum
Thanks Chiwan and Chesnay I'm happy :-) On lun., mar. 7, 2016 at 14:18, Chiwan Park wrote: Hi Toletum, You can initialize a JDBC connection with RichSinkFunction [1]. There are two methods, `open` and `close`. The `open` method is called once before calling `invoke` method. The `close` method

Re: DataStream, Sink and JDBC

2016-03-07 Thread Chesnay Schepler
you'll have to change your sinkfunction to extend RichSinkFunction, and then create your JDBC connection within the open method. On 07.03.2016 14:08, tole...@toletum.org wrote: Hi! I'm doing a process which reads from kafka, makes some things... and after writes on Database (NEO4J). I can read

Re: DataStream, Sink and JDBC

2016-03-07 Thread Chiwan Park
Hi Toletum, You can initialize a JDBC connection with RichSinkFunction [1]. There are two methods, `open` and `close`. The `open` method is called once before calling `invoke` method. The `close` method is called lastly. Note that you should add `transient` keyword to the JDBC connection object

DataStream, Sink and JDBC

2016-03-07 Thread toletum
Hi! I'm doing a process which reads from kafka, makes some things... and after writes on Database (NEO4J). I can read from kafka, and make some things But... I have problems with write on Database (JDBC). I tried use a SinkFunction It works, but it create a connection each invoke method