Re: problems with pg_restore and java - Mailing list pgsql-general

From Merlin Moncure
Subject Re: problems with pg_restore and java
Date
Msg-id CAHyXU0yh8pwm=TSNjEaMkk1G3wg6y96-SdO6_b_TRghtiWduqg@mail.gmail.com
Whole thread Raw
In response to problems with pg_restore and java  (Miguel Angel Hernandez Moreno <miguel.hdz.mrn@gmail.com>)
Responses Re: problems with pg_restore and java
List pgsql-general
On Thu, Sep 8, 2011 at 10:45 AM, Miguel Angel Hernandez Moreno
<miguel.hdz.mrn@gmail.com> wrote:
> Hello
>
> I have a program in java to make a backup running pg_restore, If you use
> linux give a successful outcome.
> but if you use windows I mark an error generating the socket. I think that
> it could be the environment variables in Windows.
> My java code is as follows.
>
> String  comando="";
> String env[]={ "PGPASSWORD="+String.valueOf( jPPass.getPassword() ) };
> comando=directorioBinario+" -h "+jTxIP.getText()+" -d
> "+jTxNombreTabla.getText()+" -U "+jTxNombreUsuario.getText()+"  -v -1
> "+archivoRespaldo;
>
> try {
>     p = Runtime.getRuntime().exec(comando,env);   <-------Error in windows
>     InputStream es = p.getErrorStream();
>     arch.muestraSalidaDeError(es);
> } catch (IOException ex) {
>     Logger.getLogger(gPrincipal.class.getName()).log(Level.SEVERE, null,
> ex);
> }
>
> I use my env variable to enter the password of postgres

The error string would be helpful.

merlin

pgsql-general by date:

Previous
From: Miguel Angel Hernandez Moreno
Date:
Subject: problems with pg_restore and java
Next
From: "Bob Pawley"
Date:
Subject: PSQLRestore