{"id":20191406,"url":"https://github.com/htfy96/simpledb-kotlin","last_synced_at":"2026-05-06T04:03:40.666Z","repository":{"id":86702043,"uuid":"113205017","full_name":"htfy96/simpledb-kotlin","owner":"htfy96","description":"A modernized codebase of sciore's simpledb project, powered by Kotlin and gradle","archived":false,"fork":false,"pushed_at":"2017-12-27T18:49:05.000Z","size":203,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-03T07:41:35.118Z","etag":null,"topics":["database","gradle","kotlin"],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/htfy96.png","metadata":{"files":{"readme":"README-OLD.txt","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-05T16:16:49.000Z","updated_at":"2020-04-28T07:54:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"2661fd5e-773f-4706-b63c-439f1cee02f3","html_url":"https://github.com/htfy96/simpledb-kotlin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/htfy96/simpledb-kotlin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/htfy96%2Fsimpledb-kotlin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/htfy96%2Fsimpledb-kotlin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/htfy96%2Fsimpledb-kotlin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/htfy96%2Fsimpledb-kotlin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/htfy96","download_url":"https://codeload.github.com/htfy96/simpledb-kotlin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/htfy96%2Fsimpledb-kotlin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32677933,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T02:33:58.958Z","status":"ssl_error","status_checked_at":"2026-05-06T02:33:39.611Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","gradle","kotlin"],"created_at":"2024-11-14T03:48:45.489Z","updated_at":"2026-05-06T04:03:40.657Z","avatar_url":"https://github.com/htfy96.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"                      THE SIMPLEDB DATABASE SYSTEM\r\n                  General Information and Instructions\r\n\r\n\r\nThis document contains the following sections:\r\n    * Release Notes\r\n    * Server Installation\r\n    * Running the Server\r\n    * Running Client Programs\r\n    * SimpleDB Limitations\r\n    * The Organization of the Server Code\r\n\r\n\r\nI. Release Notes:\r\n\r\n  This release of the SimpleDB system is Version 2.10, which was\r\n  uploaded on January 16, 2013.  This release provides the following\r\n  fixes to Version 2.10:\r\n\r\n    * The files simpledb.Startup and remote.SimpleDriver have been changed \n      to use a server-specific registry, instead of forcing the user to \n      run rmiregistry as a separate process.\n    * The files ConnectionAdapter, DriverAdapter, StatementAdapter, and \n      ResultSetAdapter in simpledb.remote have been changed to handle\n      the new Java 7 JDBC methods.\n    * A bug was fixed in the file SortScan.java.\n    * The new client file StudentMajorNoServer was added.\r\n\r\n  SimpleDB is distributed in a WinZip-formatted file. This file contains\r\n  four items:\r\n\r\n    * The folder simpledb, which contains the server-side Java code.\r\n    * The folder javadoc, which contains the JavaDoc documentation \r\n      of the above code.\r\n    * The folder studentClient, which contains some client-side code \r\n      for an example database.\r\n    * This document.\r\n\r\n  The author welcomes all comments, including bug reports, suggestions\r\n  for improvement, and anectodal experiences.  His email address is \r\n  sciore@bc.edu\r\n  \r\n\r\nII. Installation Instructions:\r\n\r\n  1)  Install the Java SDK, level 1.5 or higher.\r\n\r\n  2)  If you do install Java 1.5, you need to make some minor changes \r\n      to the package simpledb.remote:\r\n    \r\n      * The classes named xxxAdapter provide default implementations of \r\n        the interfaces in java.sql. Java 1.6 added several extra methods \r\n        to these interfaces. If you are using Java 1.5, just comment out \r\n        those methods. (You can tell which ones they are because you'll \r\n        get an error when you try to compile them.)\r\n      \r\n      * The classes named SimpleXXX call the SQLException constructor \r\n        with a Throwable argument.  This constructor is new to version\r\n        1.6. To use in 1.5, rewrite the code \"throw new SQLException(e)\"\r\n        to be \"throw new SQLException(e.getMessage())\".\r\n\r\n  3)  Decide where you want the server-side software to go. Let's assume \r\n      that the code will go in the folder C:\\javalib in Windows, or the \r\n      folder ~/javalib in UNIX or MacOS.\r\n\r\n  4)  Add that folder to your classpath. In other words, the javalib \r\n      folder must be mentioned in your CLASSPATH environment variable.\r\n    \r\n      * In UNIX, your home directory has an initialization file, \r\n        typically called .bashrc.  If the file does not set CLASSPATH,\r\n        add the following line to the file:  \r\n               CLASSPATH =.:~/javalib     \r\n               \r\n        Here, the �:� character separates folder names.  The command \r\n        therefore says that the folder \".\" (i.e., your current diretory) \r\n        and \"~/javalib\" are to be searched whenever Java needs to find a \r\n        class.  If the file already contains a CLASSPATH setting, modify \r\n        it to include the javalib directory.\r\n \r\n      * In Windows, you must set the CLASSPATH variable via the System \r\n        control panel.  From that control panel, choose the advanced tab \r\n        and click on the environment variables button.  You want to have \r\n        a user variable named CLASSPATH that looks like this:\r\n               .;C:\\javalib\r\n               \r\n        Here, the �;� character separates the two folder names.\r\n\r\n  5)  Copy the simpledb folder from the distribution file to that\r\n      folder. Within the simpledb folder should be subfolders \r\n      containing all of the code for SimpleDB.\r\n\r\n\r\nIII. Running the Server:\r\n\r\n  SimpleDB has a client-server architecture. You run the server code on \r\n  a host machine, where it will sit and wait for connections from clients.\r\n  It is able to handle multiple simultaneous requests from clients, \r\n  each on possibly different machines. You can then run a client program\r\n  from any machine that is able to connect to the host machine.\r\n\r\n  To run the SimpleDB server, run Java on the simpledb.server.Startup class.  \n  You must pass in the name of a folder that SimpleDB will use to hold the \n  database. For example in Windows, if you execute the command:\r\n      \r\n         \u003e start java simpledb.server.Startup studentdb\r\n             \r\n  then the server will run in a new window, using studentdb as the\r\n  database folder.  You can execute this command from any directory;\r\n  the server will always use the studentdb folder that exists in your\r\n  home directory.  If a folder with that name does not exist, then\r\n  one will be created automatically.\r\n \r\n  If everything is working correctly, when you run the server with a\r\n  new database folder the following will be printed in the server�s \r\n  window:\r\n\r\n      creating new database\r\n      new transaction: 1\r\n      transaction 1 committed\r\n      database server ready\r\n\r\n  If you run the server with an existing database folder, the following\r\n  will be printed instead:\r\n\r\n      recovering existing database\r\n      database server ready\r\n\r\n  In either case, the server will then sit awaiting connections from\r\n  clients.  As connections arrive, the server will print additional\r\n  messages in its window.\n\n  The server is implemented using RMI, and requires that an RMI registry\n  be running on port 1099. If a registry is running when the server is \n  started, it will use that registry; otherwise, it will run the registry\n  itself.\r\n\r\n\r\nIV. Running Client Programs \r\n\r\n  The SimpleDB server accepts connections from any JDBC client. The client\r\n  program makes its connection via the following code:\r\n            Driver d = new SimpleDriver();\r\n            String host = \"mymachine.com\"; //any DNS name or IP address\r\n            String url = \"jdbc:simpledb://\" + host;\r\n            Connection conn = d.connect(url, null);\r\n\r\n  Note that SimpleDB does not require a username and password, although\r\n  it is easy enough to modify the server code to do so.\r\n\r\n  The driver class SimpleDriver is contained in the package \r\n  simpledb.remote, along with the other classes that it needs. A client\r\n  program will not run unless this package in its classpath. Note that\r\n  you could install the entire SimpleDB server code on a client machine,\r\n  but that is overkill.  All you need is simpledb.remote.\r\n\r\n  The studentClient folder contains client code for a simple university\r\n  student-course database.  The folder contains two subfolders, named \r\n  simpledb and derby.  The simpledb subfolder contains programs that \r\n  run with the SimpleDB database server. The derby subfolder is not\r\n  relevant here. (It contains programs for the Derby database server,\r\n  which can be downloaded from db.apache.org. That code is used to\r\n  illustrate some examples from my text \"Database Design and\r\n  Implementation\", published by John WIley.) \r\n\r\n  The following list briefly describes the SimpleDB clients.\r\n\r\n    * CreateStudentDB creates and populates the student database used\r\n      by the other clients.  It therefore must be the first client run \r\n      on a new database. \r\n    * StudentMajors prints a table listing the names of students and \r\n      their majors.\r\n    * FindMajors requires a command-line argument denoting the name of \r\n      a department.  The program then prints the name and graduation\r\n      year of all students having that major.\r\n    * SQLInterpreter repeatedly prints a prompt asking you to enter a \r\n      single line of text containing an SQL statement.  The program then \r\n      executes that statement.  If the statement is a query, the output \r\n      table is displayed.  If the statement is an update command, then\r\n      the number of affected records is printed.  If the statement is ill\r\n      formed, and error message will be printed.  SimpleDB understands \r\n      only a limited subset of SQL, which is described below.\r\n    * ChangeMajor changes the student named Amy to be a drama major.  \r\n      It is the only client that updates the database (although you can \r\n      use SQLInterpreter to run update commands).\r\n\r\n  These clients connect to the server at \"localhost\".  If the client is  \r\n  to be run from a different machine than the server, then its source code \r\n  must be modified so that localhost is replaced by the domain name (or IP \r\n  address) of the server machine. \r\n  \r\n  Unlike the server classes, the client classes are not part of an \r\n  explicit package, and thus they need to be run from the directory that\r\n  they are stored in. For example, suppose we copy the studentClient \r\n  folder from the distribution file to our home directory.  In Windows\r\n  we could execute the client programs as follows:\r\n\r\n             \u003e cd C:\\studentClient\\simpledb\r\n             \u003e java CreateStudentDB\r\n\r\n\r\nV. Running SimpleDB as a Standalone Program\n\n  It is possible to write a program that calls the SimpleDB source code \n  directly, instead of calling server.Startup. The demo program \n  StudentMajorNoServer is an example. In this case, the entire database \n  source code is available to the program. Such programs are very useful\n  for testing changes to the source code without having to run the server \n  and a client.  \n\n\nVI. SimpleDB Limitations\r\n\r\n  SimpleDB is a teaching tool. It deliberately implements a tiny subset\r\n  of SQL and JDBC, and (for simplicity) imposes restrictions not present\r\n  in the SQL standard.  Here we briefly indicate these restrictions.\r\n\r\n\r\n  SimpleDB SQL\r\n  \r\n  A query in SimpleDB consists only of select-from-where clauses in which\r\n  the select clause contains a list of fieldnames (without the AS \r\n  keyword), and the from clause contains a list of tablenames (without\r\n  range variables).\r\n \r\n  The where clause is optional.  The only Boolean operator is and.  The\r\n  only comparison operator is equality.  Unlike standard SQL, there are\r\n  no other comparison operators, no other Boolean operators, no arithmetic\r\n  operators or built-in functions, and no parentheses.  Consequently,\r\n  nested queries, aggregation, and computed values are not supported.\r\n\r\n  Views can be created, but a view definition can be at most 100 \r\n  characters.\r\n \r\n  Because there are no range variables and no renaming, all field names in\r\n  a query must be disjoint.  And because there are no group by or order by\r\n  clauses, grouping and sorting are not supported.  Other restrictions:\r\n\r\n    * The \"*\" abbreviation in the select clause is not supported.\r\n    * There are no null values.\r\n    * There are no explicit joins or outer joins in the from clause.\r\n    * The union and except keywords are not supported.\r\n    * Insert statements take explicit values only, not queries.\r\n    * Update statements can have only one assignment in the set clause.\r\n\r\n\r\n  SimpleDB JDBC\r\n  \r\n  SimpleDB implements only the following JDBC methods:\r\n\r\n   Driver\r\n\r\n      public Connection connect(String url, Properties prop);\r\n      // The method ignores the contents of variable prop.\r\n\r\n   Connection\r\n\r\n      public Statement createStatement();\r\n      public void      close();\r\n\r\n   Statement\r\n\r\n      public ResultSet executeQuery(String qry);\r\n      public int       executeUpdate(String cmd);\r\n\r\n   ResultSet\r\n\r\n      public boolean   next();\r\n      public int       getInt();\r\n      public String    getString();\r\n      public void      close();\r\n      public ResultSetMetaData getMetaData();\r\n\r\n   ResultSetMetaData\r\n\r\n      public int        getColumnCount();\r\n      public String     getColumnName(int column);\r\n      public int        getColumnType(int column);\r\n      public int getColumnDisplaySize(int column);\r\n\r\n\r\nVII. The Organization of the Server Code\r\n\r\n  SimpleDB is usable without knowing anything about what the code looks\r\n  like. However, the entire point of the system is to make the code\r\n  easy to read and modify.  The basic packages in SimpleDB are structured\r\n  hierarchically, in the following order:\r\n\r\n    * file (Manages OS files as a virtual disk.)\r\n    * log (Manages the log.)\r\n    * buffer (Manages a buffer pool of pages in memory that acts as a\r\n              cache of disk blocks.)\r\n    * tx (Implements transactions at the page level.  Does locking\r\n          and logging.)\r\n    * record (Implements fixed-length records inside of pages.)\r\n    * metadata (Maintains metadata in the system catalog.)\r\n    * query (Implements relational algebra operations.  Each operation \r\n             has a plan class, used by the planner, and a scan class,\r\n             used at runtime.)\r\n    * parse (Implements the parser.)\r\n    * planner (Implements a naive planner for SQL statements.)\r\n    * remote (Implements the server using RMI.)\r\n    * server (The place where the startup and initialization code live. \r\n              The class Startup contains the main method.)\r\n\r\n  The basic server is exceptionally inefficient.  The following packages\r\n  enable more efficient query processing:\r\n\r\n    * index (Implements static hash and btree indexes, as well as \r\n             extensions to the parser and planner to take advantage\r\n             of them.)\r\n    * materialize (Implements implementations of the relational \r\n                   operators materialize, sort, groupby, and mergejoin.)\r\n    * multibuffer (Implements modifications to the sort and product \r\n                   operators, in order to make optimum use of available\r\n                   buffers.)\r\n    * opt (Implements a heuristic query optimizer)\r\n \r\n   The textbook \"Database Design and Implementation\" describes these\r\n   packages in considerably more detail. For further information, go\r\n   to the URL www.wiley.com/college/sciore\r\n   ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhtfy96%2Fsimpledb-kotlin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhtfy96%2Fsimpledb-kotlin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhtfy96%2Fsimpledb-kotlin/lists"}