gs-loader caused an error

Asked by Onari Tanaka

After I installed and configured stado, gs-loader caused following error.
It seems that Stado does not import ../lib/postgresql.jar(postgresql-9.2-1000.jdbc4.jar) and
could not connect Underlying Database.
Do you have any ideas why gs-loader caused an error ?

 ./gs-loader.sh -d dbname -u admin -p secret -f '|' -i tablename.file -t tablename
 SQLException: ERROR: java.lang.UnsupportedOperationException: The connection does not support COPY

Environment
  -OS CentOS 6.2
  -nstalled JDK 1.6, PostgreSQL 9.2 and Stado2.5
  -copied postgresql-9.2-1000.jdbc4.jar to ../lib/postgresql.jar
   (postgresql-9.2-1000.jdbc4.jar is a PostgreSQL JDBC latest version)

More Informations
  -psql COPY command to Agent Node works normally.
    cat tablefilename.file | psql -h dbhost -p 5432 -d __dbname__N2 -U stado -a -e -E -c "COPY tablename FROM STDIN DELIMITERS '|'"
  -gs-cmdline works normally.
    Stado-> INSERT INTO databasename VALUES( ...);
  -JAVA Program without Stado (imported only postgresql-9.2-1000.jdbc4.jar) works normally
    Class.forName("org.postgresql.Driver");
    con = DriverManager.getConnection(url, user, password);
    CopyManager cm = new CopyManager((BaseConnection) con);
    fw = new FileWriter("tablename.file");
    cm.copyIn("COPY tablename FROM STDIN DELIMITERS '|'", fw);

Question information

Language:
English Edit question
Status:
Solved
For:
Stado Edit question
Assignee:
No assignee Edit question
Solved by:
Alvin Peng
Solved:
Last query:
Last reply:
Revision history for this message
Best Alvin Peng (pengalvin) said :
#1

Hi,

Maybe you need to use "org.postgresql.driver.Driver" instead of "org.postgresql.Driver".
Stado has its own Driver built in stado.jar, so the ../lib/postgresql.jar is not imported.

Alvin

Revision history for this message
Onari Tanaka (onari-tanaka) said :
#2

I see, thanks Alvin.

I will run Stado 2.5 on following environment with Stado JDBC Driver.
   Java 1.6
  PostgreSQL 9.1

Stado 2.5 does not work following environment,
because Stado 2.5 itself has its own JDBC Driver and does not match Java 1.7 and
PostgreSQL 9.2.

Revision history for this message
Onari Tanaka (onari-tanaka) said :
#3

Thanks Alvin Peng, that solved my question.