diff options
Diffstat (limited to 'Dozentenmodul_V1/src/db/MySQL.java')
| -rw-r--r-- | Dozentenmodul_V1/src/db/MySQL.java | 30 |
1 files changed, 28 insertions, 2 deletions
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();
|
