Forum Stats

  • 3,770,605 Users
  • 2,253,140 Discussions
  • 7,875,506 Comments

Discussions

Properities class java -inserts the records

896976
896976 Member Posts: 172
edited Jul 24, 2017 4:05AM in Java User Groups Discussions

How I can make this method to insert records, it is saving the records but I need to insert. It is overriding the existing record.

private static void saveProperties(Properties student)

    {

        // save contents of table

        try

        {

          FileOutputStream output = new FileOutputStream("students.dat");       

         student.store(output, "Sample Properties"); // save properties

          output.close();

          System.out.println("After saving the Inventory");

          listProperties(inventory);

        }

        catch (IOException ioException)

        {

          ioException.printStackTrace();

        }

    }

Answers