Database Engine that supports some features like:
- Creating a table
- Inserting into a table
- Updating a table
- Deleting from a table
- Selecting from a table
- Creating an Index -using B+ Tree-
- Writing SQL queries
- Supported data types: int (java.lang.Integer), double (java.lang.Double) and varchar (java.lang.String)
- Language used is Java
- Project is built using maven
- Tests are written in Junit5
- GUI is built with JavaFx
- SQL is parsed using ANTLR
SQLTerm[] sqlTerms = new SQLTerm[2];
sqlTerms[0] = new SQLTerm("Students", "gpa", "=", 4.0);
sqlTerms[1] = new SQLTerm("Students", "id", ">", 100);
String[] strArrOperator = new String[] { "AND" };
engine.selectFromTable(sqlTerms, strArrOperator);
StringBuffer command = new StringBuffer("SELECT * FROM Students WHERE gpa = 4.0 AND id > 100");
engine.parseSQL(command);
Hashtable<String, Object> htblColNameValue = new Hashtable<>();
htblColNameValue.put("id", 1);
htblColNameValue.put("name", "student1");
htblColNameValue.put("gpa", 3.3);
engine.insertIntoTable("Students", htblColNameValue);
StringBuffer command = new StringBuffer("INSERT INTO Students(id, gpa, name) VALUES(1, 3.3, 'student1')");
engine.parseSQL(command);
Hashtable<String, Object> htblColNameValue = new Hashtable<>();
htblColNameValue.put("gpa", 3.3);
engine.DeleteFromTable("Students", htblColNameValue);
StringBuffer command = new StringBuffer("DELETE FROM Students WHERE gpa = 3.3");
engine.parseSQL(command);
1- Clone the project
git clone https://github.com/AhmedHawater2003/Database-Engine.git
2- Go to the project directory
3- Build the project using Maven
mvn clean
4- Run Javafx project using Maven
mvn javafx:run