From 2a3ec0fbda66ed07adcdc968a9365096ecd54f40 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 25 Feb 2014 11:04:51 +0100 Subject: Kommunikation von BwLehrpool Suite zu BwLehrpool Suite Server läuft nun über Thrift --- Dozentenmodulserver/src/sql/SQL.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'Dozentenmodulserver/src/sql') diff --git a/Dozentenmodulserver/src/sql/SQL.java b/Dozentenmodulserver/src/sql/SQL.java index eb5021c4..b07de35b 100644 --- a/Dozentenmodulserver/src/sql/SQL.java +++ b/Dozentenmodulserver/src/sql/SQL.java @@ -160,7 +160,7 @@ public class SQL { return -1; } - public int setImageData(Connection con, int pk_person, boolean license, boolean internet, int cpu, int ram, String imagename) + public boolean setImageData(Connection con, int pk_person, boolean license, boolean internet, long cpu, long ram, String imagename) { DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); @@ -187,7 +187,7 @@ public class SQL { // TODO Auto-generated catch block e.printStackTrace(); } - return ram; + return true; } @@ -195,7 +195,7 @@ public class SQL { try { Statement stm=con.createStatement(); - return stm.executeQuery("SELECT distinct vl.image_name, vl.cond_hasLicenseRestriction, os.name, '',vl.image_update_time, Concat(u.Nachname,' ',u.Vorname) FROM bwLehrpool.m_VLData_imageInfo vl, bwLehrpool.m_operatingSystem os, bwLehrpool.m_user u Where vl.content_operatingSystem=os.operatingSystemID and vl.image_owner=u.userID;"); + return stm.executeQuery("SELECT distinct vl.image_name, vl.cond_hasLicenseRestriction, os.name, '',vl.image_update_time, Concat(u.Nachname,' ',u.Vorname) as user FROM bwLehrpool.m_VLData_imageInfo vl, bwLehrpool.m_operatingSystem os, bwLehrpool.m_user u Where vl.content_operatingSystem=os.operatingSystemID and vl.image_owner=u.userID;"); } catch (SQLException e) { @@ -209,7 +209,7 @@ public class SQL { try { Statement stm=con.createStatement(); - return stm.executeQuery("SELECT vl.image_name, vl.cond_hasLicenseRestriction, os.name, lect.name, vl.image_update_time, Concat(u.Nachname,' ',u.Vorname) FROM bwLehrpool.m_VLData_imageInfo vl, bwLehrpool.m_operatingSystem os, bwLehrpool.m_VLData_lecture lect, bwLehrpool.m_user u Where vl.content_operatingSystem=os.operatingSystemID and lect.imageID=vl.GUID_imageID and vl.image_owner=u.userID;"); + return stm.executeQuery("SELECT vl.image_name, vl.cond_hasLicenseRestriction, os.name, lect.name as lecture, vl.image_update_time, Concat(u.Nachname,' ',u.Vorname) as user FROM bwLehrpool.m_VLData_imageInfo vl, bwLehrpool.m_operatingSystem os, bwLehrpool.m_VLData_lecture lect, bwLehrpool.m_user u Where vl.content_operatingSystem=os.operatingSystemID and lect.imageID=vl.GUID_imageID and vl.image_owner=u.userID;"); } catch (SQLException e) { @@ -249,11 +249,12 @@ public class SQL { return null; } - public int setLectureData(Connection con, int pk_person, int pk_image,int imageversion, String name, String desc, String shortdesc,Date start, Date end, boolean isactive) + public int setLectureData(Connection con, int pk_person, int pk_image,int imageversion, String name, String desc, String shortdesc,String start, String end, boolean isactive) { DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); int active_bol=0; + if(isactive==true) { active_bol=1; @@ -262,7 +263,7 @@ public class SQL { Statement stm=con.createStatement(); Random random=new Random(); int uid=random.nextInt(); - stm.executeUpdate("INSERT INTO `bwLehrpool`.`m_VLData_lecture`(`lectureID`,`name`,`isActive`,`startTime`,`endTime`,`lastUsed`,`shortDescription`,`description`,`imageID`,`imageVersion`,`admin_createTime`,`admin_changeTime`,`admin_owner`,`admin_change_by`)VALUES('"+uid+"','"+name+"','"+active_bol+"','"+formatter.format(start)+"','"+formatter.format(end)+"','"+formatter.format(new Date())+"','"+shortdesc+"','"+desc+"','"+pk_image+"','"+imageversion+"','"+formatter.format(new Date())+"','"+formatter.format(new Date())+"','"+pk_person+"','"+pk_person+"');"); + stm.executeUpdate("INSERT INTO `bwLehrpool`.`m_VLData_lecture`(`lectureID`,`name`,`isActive`,`startTime`,`endTime`,`lastUsed`,`shortDescription`,`description`,`imageID`,`imageVersion`,`admin_createTime`,`admin_changeTime`,`admin_owner`,`admin_change_by`)VALUES('"+uid+"','"+name+"','"+active_bol+"','"+start+"','"+end+"','"+formatter.format(new Date())+"','"+shortdesc+"','"+desc+"','"+pk_image+"','"+imageversion+"','"+formatter.format(new Date())+"','"+formatter.format(new Date())+"','"+pk_person+"','"+pk_person+"');"); con.commit(); } catch (SQLException e) { -- cgit v1.2.3-55-g7522