简体   繁体   中英

POSTGRESQL JDBC Error Unable to recreate exception from backed error: java.io.IOException: JDBC Error

I am trying to run a pig script

register 'hdfs://localhost:8020/user/pig/jars/postgresql-9.3-1100.jdbc4.jar';
register 'hdfs://localhost:8020/user/pig/jars/piggybank.jar';
a = load 'hdfs://localhost:8020/user/hive/warehouse/outage' USING PigStorage(',') AS (no:int, name:chararray, age:int);
STORE a INTO 'test' USING org.apache.pig.piggybank.storage.DBStorage('org.postgresql.Driver','jdbc:postgresql://127.0.0.1:5432/hivedata','postgres','123','INSERT INTO test (no, name, age)values(?,?,?)');

I am getting the data from hive but cannot write to postgresql

ERROR org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.Launcher - Backend     error message
java.io.IOException: java.lang.RuntimeException: JDBC error

database "hivedata" does not exist - here's your error.

Remember that as a rule of thumb, in Java stack straces the last Caused By: clause is the most relevant exception.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM