Skip to content

A relational database management system created using Java

License

Notifications You must be signed in to change notification settings

katrin-ibrahim/Java-SQL-Engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java-SQL-Engine

This project's aim is to closely re-create the functionality of a relational database management system such as SQL using Java.

How to Run Locally

  • Import the project as a maven project in your ide of choice
  • Use the class DBApp.java to run whichever methods you would like

Available Methods

1. CreateTable following method creates one table only

  • strClusteringKeyColumn is the name of the column that will be the primary key and the clustering column as well. The data type of that column will be passed in htblColNameType
  • htblColNameValue will have the column name as key and the data type as value
  • htblColNameMin and htblColNameMax for passing minimum and maximum values for data in the column. Key is the name of the column.
public void createTable(String strTableName, String strClusteringKeyColumn, Hashtable<String,String> htblColNameType, Hashtable<String,String> htblColNameMin,Hashtable<String,String> htblColNameMax) throws DBAppException

2.createIndex following method creates one index – either multidimensional , or single dimension depending on the count of column names passed.

public void createIndex(String strTableName,String[] strarrColName) throws DBAppException

3. insertIntoTable following method inserts one row only. htblColNameValue must include a value for the primary key

public void insertIntoTable(String strTableName, Hashtable<String,Object> htblColNameValue) throws DBAppException

4. updateTable following method updates one row only

  • htblColNameValue holds the key and new value
  • htblColNameValue will not include clustering key as column name
  • strClusteringKeyValue is the value to look for to find the rows to update.
public void updateTable(String strTableName,String strClusteringKeyValue, Hashtable<String,Object> htblColNameValue )throws DBAppException

5. deleteFromTable following method could be used to delete one or more rows.

  • htblColNameValue holds the key and value. This will be used in search
  • to identify which rows/tuples to delete.
  • htblColNameValue enteries are ANDED together
public void deleteFromTable(String strTableName,Hashtable<String,Object> htblColNameValue) throws DBAppException

6. selectFromTable

public Iterator selectFromTable(SQLTerm[] arrSQLTerms,String[] strarrOperators) throws DBAppException

About

A relational database management system created using Java

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages