3 import java
.util
.ArrayList
;
6 public class MySQLManager
8 private static final String DB_SCHEMA
= "team3";
9 private static final String DB_URL
= "jdbc:mysql://robocomp.dyndns.org/" + DB_SCHEMA
;
10 private static final String DB_USER
= "team3";
11 private static final String DB_PASS
= "team3";
13 private static Connection conn
;
19 conn
= DriverManager
.getConnection(DB_URL
, DB_USER
, DB_PASS
);
20 System
.out
.println("Database connected");
22 catch (SQLException se
) {
31 public static ArrayList
<Student
> get_students()
33 ArrayList
<Student
> students
= null;
36 students
= new ArrayList
<Student
>();
38 Statement st
= conn
.createStatement();
39 st
.executeQuery("select * from student order by LName;");
41 ResultSet rs
= st
.getResultSet();
44 students
.add(new Student(rs
));
47 catch (SQLException se
) {
55 public static RepetoireList
get_student_repetoire(int sid
)
57 RepetoireList rlist
= null;
60 Statement st
= conn
.createStatement();
61 st
.executeQuery("select * from repetoire where Student_idStudent=" +
64 ResultSet rs
= st
.getResultSet();
66 rlist
= new RepetoireList(rs
);
68 catch (SQLException se
) {