POSTGRESQL JDBC错误无法从支持的错误重新创建异常:java.io.IOException:JDBC错误

时间:2014-03-07 11:25:32

标签: java postgresql jdbc hive apache-pig

我正在尝试运行猪脚本

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(?,?,?)');

我从hive获取数据但无法写入postgresql

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

1 个答案:

答案 0 :(得分:0)

database "hivedata" does not exist - 这是你的错误。

请记住,根据经验,在Java堆栈中,最后一个Caused By:子句是最相关的例外。