I would suggest you to use JDBC connector in mappartition instead of maps as JDBC connections are costly & can really impact your performance.
Mayur Rustagi Ph: +1 (760) 203 3257 http://www.sigmoidanalytics.com @mayur_rustagi <https://twitter.com/mayur_rustagi> On Tue, Aug 26, 2014 at 6:45 PM, Akhil Das <ak...@sigmoidanalytics.com> wrote: > Yes, you can open a jdbc connection at the beginning of the map method > then close this connection at the end of map() and in between you can use > this connection. > > Thanks > Best Regards > > > On Tue, Aug 26, 2014 at 6:12 PM, Ravi Sharma <raviprincesha...@gmail.com> > wrote: > >> Hello People, >>> >>> I'm using java spark streaming. I'm just wondering, Can I make simple >>> jdbc connection in JavaDStream map() method? >>> >>> Or >>> >>> Do I need to create jdbc connection for each JavaPairDStream, after map >>> task? >>> >>> Kindly give your thoughts. >>> >>> >>> Cheers, >>> Ravi Sharma >>> >> >> >