diff options
| author | tspitzer | 2013-07-31 12:34:49 +0200 |
|---|---|---|
| committer | tspitzer | 2013-07-31 12:34:49 +0200 |
| commit | 631fa9ca94754e9a20d8bfd5225e63b7dc7f108e (patch) | |
| tree | 9e4b2fa952e50335e5adca4f4be2b2ee648ae462 /Dozentenmodul_V1/src/db/MySQL.java | |
| parent | erste SQL Abfragen (diff) | |
| download | tutor-module-631fa9ca94754e9a20d8bfd5225e63b7dc7f108e.tar.gz tutor-module-631fa9ca94754e9a20d8bfd5225e63b7dc7f108e.tar.xz tutor-module-631fa9ca94754e9a20d8bfd5225e63b7dc7f108e.zip | |
new
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();
|
