How to get the value to this method
<p>I have a project working with database, I have some main classes like student, module, enrolment and more 3 class to manage them. The problem in here is that</p>

<p>In the class Student I have this code </p>

<p>private String id;</p>

<pre><code>@DomainConstraint(optional = false, mutable = true, type = Type.String, length = 50)
private String name;

@DomainConstraint(optional = false, mutable = true, type = Type.String, length = 20)
private String dob;

@DomainConstraint(optional = false, mutable = true, type = Type.String, length = 50)
private String address;

@DomainConstraint(optional = false, mutable = true, type = Type.String, length = 50)
private String email;

private static int autoIncrementInt = 0;

public Student(String name, String dob, String address, String email) {
    this.name = name;
    this.dob = dob;
    this.address = address;
    this.email = email;
    idGenerator();
}
</code></pre>

<p>But in class EnrolmentManager, I want to take the name of student to enrol them to courses like this</p>

<pre><code>public void load() throws SQLException {
    Connection con;
    Properties connectionProps = new Properties();
    // set up properties, e.g. user name/password
    con = DriverManager.getConnection("jdbc:derby:courseman;create=false", connectionProps);
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery("SELECT Student.name as studentName, Module.name as Modulename, Enrolment.internalMark,Enrolment.examMark FROM Student,Module,Enrolment WHERE Student.id=Enrolment.sid AND Module.code=Enrolment.mcode");

    while (rs.next()) {
        String s = rs.getString("studentName");
        String m = rs.getString("Modulename");
        double y = rs.getDouble("internalMark");
        double d = rs.getDouble("examMark");
        Enrolment e = new Enrolment( s, m, y, d);
        enrolments.add(e);
    }
}
</code></pre>

<p>An error in here because in class Enrolment I have its Constructor is </p>

<pre><code>public Enrolment(Student stu, Module module,Double internalMark, Double examMark) {
    this.student = stu;
    this.module = module;
    this.internalMark = internalMark;
    this.examMark = examMark;
    finalGradeGenerator();
}
</code></pre>

<p>therefore in class <code>EnrolmentManager</code>, it have an error is the constructor Enrolment is undifined. Can you solve this problem for me, thank you</p>
