/JDBCBulkInsert

Example of how to run JDBCBulkInsert

Primary LanguageJava

JDBCBulkInsert

See Pivotal Blog for more info
Building

mvn package

Create table

gpadmin=# create table jdbc_load (a text, b text, c text, d text, e text );
CREATE TABLE

Create a TAB delimited file in /tmp/test.txt

lksdfd	slkdfjds	klsdjfwo	sodifjds	fdlksjfew
lksdfd	slkdfjds	klsdjfwo	sodifjds	fdlksjfew
lksdfd	slkdfjds	klsdjfwo	sodifjds	fdlksjfew
lksdfd	slkdfjds	klsdjfwo	sodifjds	fdlksjfew
lksdfd	slkdfjds	klsdjfwo	sodifjds	fdlksjfew
lksdfd	slkdfjds	klsdjfwo	sodifjds	fdlksjfew
lksdfd	slkdfjds	klsdjfwo	sodifjds	fdlksjfew
lksdfd	slkdfjds	klsdjfwo	sodifjds	fdlksjfew
lksdfd	slkdfjds	klsdjfwo	sodifjds	fdlksjfew
lksdfd	slkdfjds	klsdjfwo	sodifjds	fdlksjfew
lksdfd	slkdfjds	klsdjfwo	sodifjds	fdlksjfew
lksdfd	slkdfjds	klsdjfwo	sodifjds	fdlksjfew
lksdfd	slkdfjds	klsdjfwo	sodifjds	fdlksjfew
lksdfd	slkdfjds	klsdjfwo	sodifjds	fdlksjfew
lksdfd	slkdfjds	klsdjfwo	sodifjds	fdlksjfew

Exectuing copy

[gpadmin@hdm1 ~]$ /usr/java/default/bin/java -classpath JDBCBulkInsert-1.0-jar-with-dependencies.jar io.pivotal.support.JDBCBulkInsert "jdbc:postgresql://localhost:5432/gpadmin" gpadmin gpadmin /tmp/test.txt jdbc_load;
~# Loading Driver org.postgresql.Driver
~# connecting to database with url jdbc:postgresql://localhost:5432/gpadmin
~# reading in file /tmp/test.txt
~# COPY operation completed successfully