Alex Rivera | Logout

DataBase (datamodel) to build a folder structure

Asked 2011-09-23T03:15:12.857
9

Planning on building a Folder based structure in Java.

I will be using a jquery plugin for the GUI, so I don't need need information on how to display the folder structure.

I am looking for the backend logic on how folder information is stored, such that it can be retrieved in a quick and efficient manner.

Each folder will have multiple subfolders. From a leaf folder, we should be able access the root quickly and efficiently

Example:

+Folder1
  |__SubFolder1_1
  |__SubFolder1_2
        |_SubSubFolder1_2_1
        |_
+Folder2
  |__SubFolder2_1
        |_SubFolder2_1_1
        |_SubFolder2_1_2
             |_SubFolder2_1_2_1

New folders could be added randomly. Folder can be renamed. Folders can be deleted.

My Question is:

How would these folder details be stored in the database?

Again, I am looking for a fast and efficient means of storing and retrieving this information.

Edit
Report

1 Answer

0

Linked List, which is documented in the Java API here:

http://download.oracle.com/javase/6/docs/api/java/util/LinkedList.html

As a general Computer Science structure, read this:

http://en.wikipedia.org/wiki/Linked_list

I hope it helps

answered 2011-09-23T03:18:54.337

Your Answer