Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
im on Linux
i try to execute psql command line from tJava routine
but no query are good... but when i execute in command line linux are correctly execute.
here for exemple sql query :
"\"\\SELECT NOW();\""
my syntaxe are bad for Talend -> tJava routine ?
plz dont tel me that i do not have to use psql in command line i'm forced by the existing.
ProcessBuilder pb = new ProcessBuilder("/usr/bin/psql" ,"-h",this.getHost(),"-p",this.getPort(),"-U",this.getLogin(),"-d",this.getDataBase(),"-c", "\"\\SELECT NOW();\"");
pb.directory(exec);
Map<String, String> env = pb.environment();
env.put("PGPASSWORD", this.getPassword());
Process p = pb.start();
my error message is :
java.sql.SQLException: ERROR: syntax error at or near ""SELECT NOW();""LINE 1: "SELECT NOW();" ^
i tried :
'\SELECT NOW();'
"\SELECT NOW();"
"SELECT NOW();"
"SELECT NOW()"
nothing.
if you have an idea ?
Thanks a lot.
C'est bon, j'ai trouvé, j'ai enlevé tous les caractères d'échappement utiles sous windows.
C'est bon, j'ai trouvé, j'ai enlevé tous les caractères d'échappement utiles sous windows.