From 631fa9ca94754e9a20d8bfd5225e63b7dc7f108e Mon Sep 17 00:00:00 2001 From: tspitzer Date: Wed, 31 Jul 2013 12:34:49 +0200 Subject: new --- Dozentenmodul_V1/src/db/MySQL.java | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'Dozentenmodul_V1/src/db/MySQL.java') diff --git a/Dozentenmodul_V1/src/db/MySQL.java b/Dozentenmodul_V1/src/db/MySQL.java index 6e6d84c0..ac02d8c4 100644 --- a/Dozentenmodul_V1/src/db/MySQL.java +++ b/Dozentenmodul_V1/src/db/MySQL.java @@ -65,12 +65,38 @@ public class MySQL { } - public ResultSet getActiveVLs(Connection con, String Mail) + public ResultSet getUserpk(Connection con, String Mail) { Statement stm; try { stm = con.createStatement(); - return stm.executeQuery("Select Laborname from bwLehrpool.VM where IstAktiv=1 and pk=(SELECT VM_pk FROM bwLehrpool.Benutzer_has_VM where Benutzer_pk=(SELECT pk FROM bwLehrpool.Benutzer where EMail like '"+Mail+"'));"); + return stm.executeQuery("SELECT pk FROM bwLehrpool.Benutzer where EMail like '"+Mail+"';"); + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return null; + } + + public ResultSet getVMpk(Connection con, String Userpk) + { + Statement stm; + try { + stm = con.createStatement(); + return stm.executeQuery("SELECT VM_pk FROM bwLehrpool.Benutzer_has_VM where Benutzer_pk="+Userpk+";"); + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return null; + } + + public ResultSet getActiveVLs(Connection con, String VMpk) + { + Statement stm; + try { + stm = con.createStatement(); + return stm.executeQuery("Select Laborname from bwLehrpool.VM where IstAktiv=1 and pk="+VMpk+";"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); -- cgit v1.2.3-55-g7522