In general, I want to know how SQL is implemented at the lower level, it looks like
the algorithm used is close to O (1) ..... in Java, you can only achieve this with
hashmaps, I wander how they did it
Example:
If I have a group of students and a group of classes to select any of the students who belong to those classes
or any class contains a group of students, I would create a relational database in which there are three tables:
student table, class table, relationship table
which should represent a good many-to-many relationship
however, if I do not want to use SQL, JDBC, create and create tables
how can i implement this in pure java
I would like something like
List<Student> getStudentsByClass(String className)
or
List<Class> getClassesByStudent(String StudentName)
Ideally, I will have hashMap using a unique studentID as a key, and the actual studentObject as a value and another hasMap uing classID as key and classObject as the value
then the ArrayList relation contains all the relation objects, inside the relation object you have 2 files, classID and studentID
the problem is that I don't want to iterate over the ArrayList relation every time I do a search
I know that there is a method for comparing an object that I can override with one that only helps you sort obejcts; it does not help with the choice of not?
there is a link, I understand everything, but not a choice of bits, not one of them, please consult!
http://www.javaworld.com/javaworld/jw-11-2004/jw-1122-select.html?page=3