Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions schoolSystemAssignment-master/SchoolSystem.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="mysql-connector-j-9.6.0" level="project" />
</component>
</module>
23 changes: 23 additions & 0 deletions schoolSystemAssignment-master/src/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
class DatabaseConnection {
private static final String URL = "jdbc:mysql://localhost:3306/schoolSystem";
private static final String USER = "fush";
private static final String PASSWORD = "Password123_";

static Connection getConnection() throws SQLException {
return DriverManager.getConnection(URL, USER, PASSWORD);
}
//connection trial
//db installation on local host

public static void main(String[] args) {
try (Connection conn = getConnection()) {
System.out.println("Connected to MySQL successfully!");
} catch (SQLException e) {
System.out.println("Connection failed: " + e.getMessage());
}
}
}

5 changes: 5 additions & 0 deletions schoolSystemAssignment-master/src/classFiles/Course.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package classFiles;
public interface Course {
abstract String programID();
abstract String courseName();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
public class CourseOffering {
private int courseid;
private string lecturerid;
private String semesterid;
private String programid;



}
31 changes: 31 additions & 0 deletions schoolSystemAssignment-master/src/classFiles/Lecturer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package classFiles;
public class Lecturer implements Person {
private String name;
private final String id;
private String email;
private String phoneNumber;
public Lecturer(String name, String id, String email, String phoneNumber) {
this.name = name;
this.id = id;
this.email= email;
this.phoneNumber = phoneNumber;
}
@Override
public String name() {
return this.name;
}
@Override
public String id() {
return this.id;
}
@Override
public String email(){
return this.email;
}
@Override
public String phoneNumber(){
return this.phoneNumber;
}


}
9 changes: 9 additions & 0 deletions schoolSystemAssignment-master/src/classFiles/Person.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package classFiles;
public interface Person {
abstract String name();
abstract String id();
abstract String email();
abstract String phoneNumber();


}
18 changes: 18 additions & 0 deletions schoolSystemAssignment-master/src/classFiles/Program.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package classFiles;

public class Program implements Course {
private final String programID;
private String courseName;
public Program(String programID, String courseName) {
this.programID = programID;
this.courseName = courseName;
}
@Override
public String programID() {
return this.programID;
}
@Override
public String courseName() {
return this.courseName;
}
}
38 changes: 38 additions & 0 deletions schoolSystemAssignment-master/src/classFiles/Student.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package classFiles;

public class Student implements Person{
private String name;
private String id;
private String email;
private String phoneNumber;
public Student(String name, String id, String email, String phoneNumber) {
this.name = name;
this.id = id;
this.email= email;
this.phoneNumber = phoneNumber;
}
@Override
public String name() {
return this.name;
}
@Override
public String id() {
return this.id;
}
@Override
public String email(){
return this.email;
}
@Override
public String phoneNumber(){
return this.phoneNumber;
}

public void getDetails(){
System.out.println("Name: "+this.name);
System.out.println("ID: "+this.id);
System.out.println("Email: "+this.email);
System.out.println("Phone Number: "+this.phoneNumber);
}

}
Empty file.
Empty file.
Empty file.
Empty file.