Use Eclipse for SimpleDB Development

This guide will walk you through the steps to set up SimpleDB as a project under Eclipse so later you can add, modify, and test SimpleDB code as required in the homework assignments.

Please download the repackaged SimpleDB source code. The original SimpleDB package is available from the author's website, but I strongly recommend that you use the repackaged version because I made several changes to make it more Ant/Eclipse friendly, i.e. easier to compile and run. For the details of the changes, please check out the README.cs422.txt file included in the package.

After the file is downloaded, in Eclipse, select File -> Import ... -> Existing Projects into Workspace. Choose Select archive file, select the zip file you downloaded, then click Finish. Now simpledb should appear in Eclipse as a Java Project, which you can compile and run just like any other Java project.

For your convenience, I included two launch files: dbserver.launch and zip.launch.

To start the SimpleDB server, first open a command window and execute the command rmiregistry, then in Eclipse, right click on dbserver.launch then select Run As -> dbserver. When the SimpleDB server starts, it creates a studentdb folder under the home directory of the current user, and all the data files will be stored in this folder. To stop the server, click the Terminate button in the Eclipse console view.

A number of SimpleDB client programs are in the simpledb.client package. To start a client, e.g. SQLInterpreter, simply right click on the class then select Run As -> Java Application. Note that SimpleDB only implements a tiny subset of SQL. The grammar of SimpleDB's query language is shown in Figure 18-4 in Chapter 18.4 of the textbook, and some of the restrictions are described in Chapter 7.6. 

After you complete a homework, right click on zip.launch then select Run As -> zip. This will create a zip file simpledb.zip under your project folder. simpledb.zip will contain all the source code and the build script build.xml, and you will be asked to submit this zip file to CSNS.

A screen capture video demonstrating this process is available at http://sun.calstatela.edu/~cysun/videos/simpledb.wmv.