From 393fe2056e4e750a8dcbc6176f230564dad04ef8 Mon Sep 17 00:00:00 2001 From: Tobias Spitzer Date: Mon, 25 Aug 2014 12:59:12 +0200 Subject: Initialrechte für Veranstaltungen nun Verfügbar --- Dozentenmodulserver/src/sql/SQL.java | 56 ++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) (limited to 'Dozentenmodulserver/src/sql/SQL.java') 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; + } } -- cgit v1.2.3-55-g7522