diff options
| author | Michael Wilson | 2014-08-25 13:37:56 +0200 |
|---|---|---|
| committer | Michael Wilson | 2014-08-25 13:37:56 +0200 |
| commit | 78882207061c9f6e93aed3c71a634fb3ed793f95 (patch) | |
| tree | b88bf7bffd9b0963c3e3218b371af02a88f470ec /Dozentenmodulserver/src/sql/SQL.java | |
| parent | Abfrage bei Schließen währen Up-Download (diff) | |
| parent | Merge branch 'master' of git.openslx.org:openslx-ng/tutor-module (diff) | |
| download | tutor-module-78882207061c9f6e93aed3c71a634fb3ed793f95.tar.gz tutor-module-78882207061c9f6e93aed3c71a634fb3ed793f95.tar.xz tutor-module-78882207061c9f6e93aed3c71a634fb3ed793f95.zip | |
Merge branch 'master' of ssh://git.openslx.org/openslx-ng/tutor-module
Diffstat (limited to 'Dozentenmodulserver/src/sql/SQL.java')
| -rw-r--r-- | Dozentenmodulserver/src/sql/SQL.java | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/Dozentenmodulserver/src/sql/SQL.java b/Dozentenmodulserver/src/sql/SQL.java index 0f222249..8a4e9ae2 100644 --- a/Dozentenmodulserver/src/sql/SQL.java +++ b/Dozentenmodulserver/src/sql/SQL.java @@ -952,4 +952,60 @@ public class SQL { }
return -1;
}
+ public int setLectureRights(String pk_person, String pk_lecture,int role ,int read, int write, int changePermission, int admin) {
+
+
+
+ try {
+ Connection con=getConnection();
+ Statement stm = con.createStatement();
+
+ String uid = UUID.randomUUID().toString();
+ stm.executeUpdate("INSERT INTO `bwLehrpool`.`pm_VLData_lecture`(`GUID`,`lectureID`,`roleID`,`userID`,`rec_read`,`rec_write`,`rec_admin`,`rec_changePermission`)VALUES('"
+ + uid
+ + "','"
+ + pk_lecture
+ + "','"
+ + role
+ + "','"
+ + pk_person
+ + "','"
+ + read
+ + "','"
+ + write
+ + "','"
+ + admin
+ + "','"
+ + changePermission+ "');");
+ con.commit();
+ con.close();
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ log.info(new Date() + " - Failed to setLectureRights.");
+ e.printStackTrace();
+ }
+ return 0;
+
+ }
+ public String getLectureID(String name) {
+ String id=null;
+ try {
+ Connection con=getConnection();
+ Statement stm = con.createStatement();
+ ResultSet lecture= stm
+ .executeQuery("SELECT lectureID FROM bwLehrpool.m_VLData_lecture where name like '"
+ + name + "';");
+ while (lecture.next()) {
+ id=lecture.getString("lectureID");
+
+ }
+ con.close();
+ return id;
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ log.info(new Date() + " - Failed to LectureID.");
+ e.printStackTrace();
+ }
+ return id;
+ }
}
|
