You are passing a null value in one of the parameters, for a field that does not allow null. Check the data that you are collecting and passing to the database. If necessary use the debugger to find out exactly what is happening.
Your code makes no sense. You have two separate methods (add and adds) to insert information into your database. You need only a single method that inserts all fields per row:
public void add ( String matric_no, String name ) {
String sql = "INSERT INTO NameList(Matric_No, Name) VALUES(?, ?)";
try {
Connection conn = this.connect();
PreparedStatement pstmt = conn.prepareStatement(sql)) {
pstmt.setString(1, matric_no);
pstmt.setString(2, name);
pstmt.executeUpdate();
} catch (SQLException e) {
System.out.println(e.getMessage());
}
}