create DB backup postgresql using java

<>

This question already has an answer here:

Answers


-D is a invalid option, and I put a host attribute.

{
    String path = "D:\\aaa";
    Runtime r = Runtime.getRuntime();

    //PostgreSQL variables    
    String host = "localhost";
    String user = "postgres";
    String dbase = "GestionPharmacie";
    String password = "*****";
    Process p;
    ProcessBuilder pb;


    r = Runtime.getRuntime();        
    pb = new ProcessBuilder("pg_dump", "-v", "-h", host, "-f", path, "-U", user, dbase);
    pb.environment().put("PGPASSWORD", password);
    pb.redirectErrorStream(true);
    p = pb.start();        

} catch (Exception e) {

Need Your Help

Rewrite part of javascript with C#

javascript c# api google-maps code-conversion

I'm writing this program in C# which should display Google Maps. I'm using the Google Maps JavaScript API which is the best one I could find. With the program you should be able to search for place...

Looping back to beginning of code

java loops

I've seen a few threads like this but I don't completely understand how I would implement it into my code.