From 3240a29571e807a146a65578c98d0f32c7e67e3e Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 28 Apr 2014 18:12:51 +0200 Subject: Logging Ausgaben verändert --- Dozentenmodulserver/src/sql/SQL.java | 64 +++++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 23 deletions(-) (limited to 'Dozentenmodulserver/src/sql') diff --git a/Dozentenmodulserver/src/sql/SQL.java b/Dozentenmodulserver/src/sql/SQL.java index ab5f28aa..8132e52d 100644 --- a/Dozentenmodulserver/src/sql/SQL.java +++ b/Dozentenmodulserver/src/sql/SQL.java @@ -29,7 +29,7 @@ public class SQL { return con; } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() + " - Could not return connection to Client."); + log.info(new Date() + " - Failed to return connection to Client."); e.printStackTrace(); } return null; @@ -52,7 +52,7 @@ public class SQL { return ret; } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() + " - FTPUser not created."); + log.info(new Date() + " - Failed to writeFTPUser."); e.printStackTrace(); } return -1; @@ -71,7 +71,7 @@ public class SQL { return ret; } catch (SQLException e) { // TODO Auto-generated catch block - log.info(new Date() + " - Could not delete FTPUser " + user + "."); + log.info(new Date() + " - Failed to DeleteUser."); e.printStackTrace(); } return -1; @@ -86,6 +86,7 @@ public class SQL { } catch (SQLException e) { // TODO Auto-generated catch block + log.info(new Date() + " - Failed to getImage."); e.printStackTrace(); } @@ -106,6 +107,7 @@ public class SQL { } catch (SQLException e) { // TODO Auto-generated catch block + log.info(new Date() + " - Failed to getPathOfImage."); e.printStackTrace(); } @@ -136,6 +138,7 @@ public class SQL { } catch (SQLException e) { // TODO Auto-generated catch block + log.info(new Date() + " - Failed to setInstitution."); e.printStackTrace(); } return -1; @@ -159,8 +162,8 @@ public class SQL { stm.executeUpdate("INSERT INTO `bwLehrpool`.`m_user`(`userID`,`loginName`,`nachname`,`vorname`,`mail`,`lastLogin`,`institution`)VALUES('" + id + "','" - +login - +"','" + + login + + "','" + lastname + "','" + firstname @@ -186,6 +189,7 @@ public class SQL { } catch (SQLException e) { // TODO Auto-generated catch block + log.info(new Date() + " - Failed to setPerson."); e.printStackTrace(); } return -1; @@ -241,6 +245,7 @@ public class SQL { } catch (SQLException e) { // TODO Auto-generated catch block + log.info(new Date() + " - Failed to setImageData."); e.printStackTrace(); } return true; @@ -256,6 +261,7 @@ public class SQL { } catch (SQLException e) { // TODO Auto-generated catch block + log.info(new Date() + " - Failed to getImageList."); e.printStackTrace(); } return null; @@ -270,6 +276,7 @@ public class SQL { } catch (SQLException e) { // TODO Auto-generated catch block + log.info(new Date() + " - Failed to getLectureList."); e.printStackTrace(); } return null; @@ -283,6 +290,7 @@ public class SQL { .executeQuery("SELECT name FROM bwLehrpool.m_operatingSystem;"); } catch (SQLException e) { // TODO Auto-generated catch block + log.info(new Date() + " - Failed to getAllOS."); e.printStackTrace(); } @@ -302,6 +310,7 @@ public class SQL { + "' and u.institution=i.institutionID;"); } catch (SQLException e) { // TODO Auto-generated catch block + log.info(new Date() + " - Failed to getPersonData."); e.printStackTrace(); } return null; @@ -353,6 +362,7 @@ public class SQL { } catch (SQLException e) { // TODO Auto-generated catch block + log.info(new Date() + " - Failed to setLectureData."); e.printStackTrace(); } return 0; @@ -367,6 +377,7 @@ public class SQL { + name + "';"); } catch (SQLException e) { // TODO Auto-generated catch block + log.info(new Date() + " - Failed to getImageIDandVersion."); e.printStackTrace(); } return null; @@ -381,6 +392,7 @@ public class SQL { + id + "' and imageVersion = '" + version + "' ;"); } catch (SQLException e) { // TODO Auto-generated catch block + log.info(new Date() + " - Failed to getImageData."); e.printStackTrace(); } return null; @@ -427,18 +439,12 @@ public class SQL { return 0; } catch (SQLException e) { // TODO Auto-generated catch block + log.info(new Date() + " - Failed to UpdateImageData."); e.printStackTrace(); } return -1; } - /** - * - * @param id - * @param version - * @return - */ - public boolean deleteImage(Connection con, String id, String version) { try { @@ -454,6 +460,7 @@ public class SQL { } catch (SQLException e) { // TODO Auto-generated catch block + log.info(new Date() + " - Failed to deleteImage."); e.printStackTrace(); } @@ -494,6 +501,7 @@ public class SQL { } catch (SQLException e) { // TODO Auto-generated catch block + log.info(new Date() + " - Failed to updateLectureData."); e.printStackTrace(); } @@ -515,6 +523,8 @@ public class SQL { } catch (SQLException e) { // TODO Auto-generated catch block + log.info(new Date() + + " - Failed to execute method connectedToLecture."); e.printStackTrace(); } @@ -523,52 +533,60 @@ public class SQL { } public boolean deleteLecture(Connection con, String id) { - + try { Statement stm = con.createStatement(); - stm.executeUpdate("DELETE FROM bwLehrpool.m_VLData_lecture WHERE lectureID = '"+ id + "';"); + stm.executeUpdate("DELETE FROM bwLehrpool.m_VLData_lecture WHERE lectureID = '" + + id + "';"); con.commit(); return true; } catch (SQLException e) { // TODO Auto-generated catch block + log.info(new Date() + " - Failed to deleteLecture."); e.printStackTrace(); } - + return false; } public String getFile(Connection con, String imageid, String imageversion) { - + try { Statement stm = con.createStatement(); - ResultSet rs=stm.executeQuery("SELECT image_path FROM bwLehrpool.m_VLData_imageInfo WHERE GUID_imageID = '" + imageid - + "' AND imageVersion = '" + imageversion + "';"); + ResultSet rs = stm + .executeQuery("SELECT image_path FROM bwLehrpool.m_VLData_imageInfo WHERE GUID_imageID = '" + + imageid + + "' AND imageVersion = '" + + imageversion + + "';"); rs.next(); return rs.getString("image_path"); } catch (SQLException e) { // TODO Auto-generated catch block + log.info(new Date() + " - Failed to getFile."); e.printStackTrace(); } return null; } - - public ResultSet getDeleteXMLData(Connection con, String id) - { + + public ResultSet getDeleteXMLData(Connection con, String id) { try { Statement stm = con.createStatement(); - ResultSet rs=stm.executeQuery("SELECT name, admin_createTime FROM bwLehrpool.m_VLData_lecture where lectureID='"+id+"';"); - + ResultSet rs = stm + .executeQuery("SELECT name, admin_createTime FROM bwLehrpool.m_VLData_lecture where lectureID='" + + id + "';"); return rs; } catch (SQLException e) { // TODO Auto-generated catch block + log.info(new Date() + " - Failed to getDeleteXMLData."); e.printStackTrace(); } -- cgit v1.2.3-55-g7522