summaryrefslogtreecommitdiffstats
path: root/Dozentenmodulserver/src/sql
diff options
context:
space:
mode:
authorunknown2014-04-10 10:29:52 +0200
committerunknown2014-04-10 10:29:52 +0200
commitec67e80ff104bf90d307bf264283eb79d937f262 (patch)
treeffd2dde8e010d3ad8c69ca5372d8f2fed3a99b65 /Dozentenmodulserver/src/sql
parentHaufen Konsolenausgaben enfernt (diff)
downloadtutor-module-ec67e80ff104bf90d307bf264283eb79d937f262.tar.gz
tutor-module-ec67e80ff104bf90d307bf264283eb79d937f262.tar.xz
tutor-module-ec67e80ff104bf90d307bf264283eb79d937f262.zip
Test
Diffstat (limited to 'Dozentenmodulserver/src/sql')
-rw-r--r--Dozentenmodulserver/src/sql/SQL.java52
1 files changed, 52 insertions, 0 deletions
diff --git a/Dozentenmodulserver/src/sql/SQL.java b/Dozentenmodulserver/src/sql/SQL.java
index 0a2f5ab2..ec1ea11f 100644
--- a/Dozentenmodulserver/src/sql/SQL.java
+++ b/Dozentenmodulserver/src/sql/SQL.java
@@ -446,4 +446,56 @@ public class SQL {
}
return -1;
}
+
+ public int updateLectureData(Connection con, int pk_person, int pk_image,
+ int imageversion, String name, String desc, String shortdesc,
+ String start, String end, boolean isactive, String id) {
+
+ DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
+ int active_bol = 0;
+
+ if (isactive == true) {
+ active_bol = 1;
+ }
+ try {
+ 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
+ + "','"
+ + 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) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return 0;
+
+ }
}