Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Backing up postgres database for use in java program eclipse

  1. #1
    Junior Member
    Join Date
    Apr 2020
    Posts
    24
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Backing up postgres database for use in java program eclipse

    Hello, so I have googled this and can't really get a straight answer that I understand. I have a postgres database. I have to export it or save it so I can use it with a java app I am developing. What format should I export it as? .sql .db? Do I do that by using the dump command? I am on ubuntu 18.04 and also using PgAdmin4 with it. I have been able to get a .backup file made but I am confused as to which is transferrable and able to be used with a eclipse/a java program. I do have the latest postgres JDBC for it installed on my version of eclipse.

    Thank you in advance.

    Edit**This is just localhost
    Last edited by Vic45; April 13th, 2020 at 06:26 PM.

  2. #2
    Junior Member
    Join Date
    Mar 2020
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Backing up postgres database for use in java program eclipse

    Are you trying to migrate the database locally? You just need to dump the database and feed it back into your new instance. This is independent from Java/Eclipse.

    Here's more info:
    https://www.postgresql.org/docs/9.1/backup-dump.html

  3. #3
    Junior Member
    Join Date
    Apr 2020
    Posts
    24
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Backing up postgres database for use in java program eclipse

    No, I am working on a project with other people. So I need it to dump it so I can use with other versions possibly. I'm not too experienced with it so yes, that may be what I need. So does the dump command in the link you showed me give just something like TestDB? No .sql or .db? I ran the command and now I cannot find the file. Do you know where it would be in ubuntu by any chance? I have tried var/lib/postgresql/10/main and also the etc path. Is there another command that would let me specify where it goes?

Similar Threads

  1. How To Set Up Database In Java Eclipse
    By hwoarang69 in forum JDBC & Databases
    Replies: 3
    Last Post: November 13th, 2012, 08:05 PM
  2. Cannot connect Java program to database
    By perry.matthew in forum JDBC & Databases
    Replies: 2
    Last Post: August 29th, 2012, 10:54 AM
  3. Reg - inserting json data to postgres db using java
    By ramya in forum JDBC & Databases
    Replies: 2
    Last Post: August 27th, 2012, 12:50 PM
  4. Reg - connecting java to postgres database
    By ramya in forum JDBC & Databases
    Replies: 2
    Last Post: August 27th, 2012, 12:50 PM
  5. Replies: 2
    Last Post: August 27th, 2012, 12:42 PM