You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@crunch.apache.org by Martijn Lenderink <ma...@gmail.com> on 2013/03/07 16:59:24 UTC

JDBC Connection

Hello all,

I'am trying to read data from an JDBC source.
I know Crunch is able to do this with the DataBaseSource class.

Can anyone give me an example on how to use this class, how to read data
from a JDBC source.

Greetings,
Martijn Lenderink

Re: JDBC Connection

Posted by Martijn Lenderink <ma...@gmail.com>.
Thanks you very much!
That was exactly the example i needed to get started.

Martijn Lenderink

2013/3/8 Rahul Sharma <ra...@gmail.com>

> You need to use org.apache.crunch.contrib.io.jdbc.DataBaseSource class for
> reading and writing data. The class takes all jdbc params as input and a
> implementation of DBWitable where you can read data.
>
> regards
> Rahul
>
>
>
> On Thu, Mar 7, 2013 at 11:53 PM, Josh Wills <jw...@cloudera.com> wrote:
>
>> +rahul
>>
>> I haven't run it myself, but Rahul wrote it and added an integration test
>> for it:
>>
>>
>> https://github.com/apache/incubator-crunch/blob/master/crunch-contrib/src/it/java/org/apache/crunch/contrib/io/jdbc/DataBaseSourceIT.java
>>
>> Does that help?
>>
>>
>> On Thu, Mar 7, 2013 at 7:59 AM, Martijn Lenderink <martijnrules@gmail.com
>> > wrote:
>>
>>> Hello all,
>>>
>>> I'am trying to read data from an JDBC source.
>>> I know Crunch is able to do this with the DataBaseSource class.
>>>
>>> Can anyone give me an example on how to use this class, how to read data
>>> from a JDBC source.
>>>
>>> Greetings,
>>> Martijn Lenderink
>>>
>>>
>>
>>
>> --
>> Director of Data Science
>> Cloudera <http://www.cloudera.com>
>> Twitter: @josh_wills <http://twitter.com/josh_wills>
>>
>

Re: JDBC Connection

Posted by Rahul Sharma <ra...@gmail.com>.
You need to use org.apache.crunch.contrib.io.jdbc.DataBaseSource class for
reading and writing data. The class takes all jdbc params as input and a
implementation of DBWitable where you can read data.

regards
Rahul


On Thu, Mar 7, 2013 at 11:53 PM, Josh Wills <jw...@cloudera.com> wrote:

> +rahul
>
> I haven't run it myself, but Rahul wrote it and added an integration test
> for it:
>
>
> https://github.com/apache/incubator-crunch/blob/master/crunch-contrib/src/it/java/org/apache/crunch/contrib/io/jdbc/DataBaseSourceIT.java
>
> Does that help?
>
>
> On Thu, Mar 7, 2013 at 7:59 AM, Martijn Lenderink <ma...@gmail.com>wrote:
>
>> Hello all,
>>
>> I'am trying to read data from an JDBC source.
>> I know Crunch is able to do this with the DataBaseSource class.
>>
>> Can anyone give me an example on how to use this class, how to read data
>> from a JDBC source.
>>
>> Greetings,
>> Martijn Lenderink
>>
>>
>
>
> --
> Director of Data Science
> Cloudera <http://www.cloudera.com>
> Twitter: @josh_wills <http://twitter.com/josh_wills>
>

Re: JDBC Connection

Posted by Josh Wills <jw...@cloudera.com>.
+rahul

I haven't run it myself, but Rahul wrote it and added an integration test
for it:

https://github.com/apache/incubator-crunch/blob/master/crunch-contrib/src/it/java/org/apache/crunch/contrib/io/jdbc/DataBaseSourceIT.java

Does that help?

On Thu, Mar 7, 2013 at 7:59 AM, Martijn Lenderink <ma...@gmail.com>wrote:

> Hello all,
>
> I'am trying to read data from an JDBC source.
> I know Crunch is able to do this with the DataBaseSource class.
>
> Can anyone give me an example on how to use this class, how to read data
> from a JDBC source.
>
> Greetings,
> Martijn Lenderink
>
>


-- 
Director of Data Science
Cloudera <http://www.cloudera.com>
Twitter: @josh_wills <http://twitter.com/josh_wills>