summaryrefslogtreecommitdiffstats
path: root/Dozentenmodul_V1/src/db/MySQL.java
diff options
context:
space:
mode:
authortspitzer2013-06-25 13:31:27 +0200
committertspitzer2013-06-25 13:31:27 +0200
commit67fe35266f74162ef719efe695d2756524856771 (patch)
treed1dced2285d4afa10357e5186e36dbbe8bfaaca8 /Dozentenmodul_V1/src/db/MySQL.java
parentnew (diff)
downloadtutor-module-67fe35266f74162ef719efe695d2756524856771.tar.gz
tutor-module-67fe35266f74162ef719efe695d2756524856771.tar.xz
tutor-module-67fe35266f74162ef719efe695d2756524856771.zip
erste SQL Abfragen
Diffstat (limited to 'Dozentenmodul_V1/src/db/MySQL.java')
-rw-r--r--Dozentenmodul_V1/src/db/MySQL.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/Dozentenmodul_V1/src/db/MySQL.java b/Dozentenmodul_V1/src/db/MySQL.java
index 64510e82..6e6d84c0 100644
--- a/Dozentenmodul_V1/src/db/MySQL.java
+++ b/Dozentenmodul_V1/src/db/MySQL.java
@@ -35,7 +35,7 @@ public class MySQL {
{
try {
Statement stm=con.createStatement();
- return stm.executeQuery("SELECT distinct Hersteller FROM bwLehrpool.Anwendung order by Hersteller asc;");
+ return stm.executeQuery("SELECT Name FROM bwLehrpool.SWHersteller order by Name asc;");
} catch (SQLException e) {
@@ -52,7 +52,7 @@ public class MySQL {
try {
Statement stm=con.createStatement();
- return stm.executeQuery("SELECT Produktname FROM bwLehrpool.Anwendung WHERE Hersteller like '"+Hersteller+"' order by Produktname asc;");
+ return stm.executeQuery("SELECT s.pk,s.Produktname, s.Version, s.Architektur FROM bwLehrpool.Software s left join bwLehrpool.SWHersteller h on s.SWHersteller_pk=h.pk where Name like '"+Hersteller+"' order by s.Produktname;");
} catch (SQLException e) {
@@ -65,12 +65,12 @@ public class MySQL {
}
- public ResultSet getActiveVLs(Connection con, int VId)
+ public ResultSet getActiveVLs(Connection con, String Mail)
{
Statement stm;
try {
stm = con.createStatement();
- return stm.executeQuery("SELECT Laborname FROM bwLehrpool.VM where IstAktiv=1 and Verantwortlicher_pk="+VId+";");
+ 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+"'));");
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -79,12 +79,12 @@ public class MySQL {
}
- public ResultSet getInactiveVLs(Connection con, int VId)
+ public ResultSet getInactiveVLs(Connection con, String Mail)
{
Statement stm;
try {
stm = con.createStatement();
- return stm.executeQuery("SELECT Laborname FROM bwLehrpool.VM where IstAktiv=0 and Verantwortlicher_pk="+VId+";");
+ return stm.executeQuery("Select Laborname from bwLehrpool.VM where IstAktiv=0 and pk=(SELECT VM_pk FROM bwLehrpool.Benutzer_has_VM where Benutzer_pk=(SELECT pk FROM bwLehrpool.Benutzer where EMail like '"+Mail+"'));");
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();