From 695c870f18e5cecfe8da7033c8db7c9c70a42c4d Mon Sep 17 00:00:00 2001 From: tspitzer Date: Mon, 30 Sep 2013 11:40:02 +0200 Subject: working --- Dozentenmodul/bin/GUI/AddOS$1.class | Bin 1449 -> 1480 bytes Dozentenmodul/bin/GUI/AddOS$2.class | Bin 615 -> 615 bytes Dozentenmodul/bin/GUI/AddOS.class | Bin 3910 -> 3910 bytes Dozentenmodul/bin/GUI/AddSoftware$1.class | Bin 1497 -> 1528 bytes Dozentenmodul/bin/GUI/AddSoftware$2.class | Bin 651 -> 651 bytes Dozentenmodul/bin/GUI/AddSoftware.class | Bin 3946 -> 3563 bytes Dozentenmodul/bin/GUI/EingabeSystemDaten$1.class | Bin 765 -> 765 bytes Dozentenmodul/bin/GUI/EingabeSystemDaten$2.class | Bin 1727 -> 1727 bytes Dozentenmodul/bin/GUI/EingabeSystemDaten$3.class | Bin 2098 -> 2098 bytes Dozentenmodul/bin/GUI/EingabeSystemDaten.class | Bin 7868 -> 7868 bytes Dozentenmodul/bin/sql/sql.class | Bin 5206 -> 5183 bytes Dozentenmodul/src/GUI/AddOS.java | 1 + Dozentenmodul/src/GUI/AddSoftware.java | 6 ++++-- Dozentenmodul/src/GUI/EingabeSystemDaten.java | 1 + Dozentenmodul/src/sql/sql.java | 12 ++++++------ 15 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Dozentenmodul/bin/GUI/AddOS$1.class b/Dozentenmodul/bin/GUI/AddOS$1.class index 21e1889b..e7863e77 100644 Binary files a/Dozentenmodul/bin/GUI/AddOS$1.class and b/Dozentenmodul/bin/GUI/AddOS$1.class differ diff --git a/Dozentenmodul/bin/GUI/AddOS$2.class b/Dozentenmodul/bin/GUI/AddOS$2.class index 5abf8061..08fffc2a 100644 Binary files a/Dozentenmodul/bin/GUI/AddOS$2.class and b/Dozentenmodul/bin/GUI/AddOS$2.class differ diff --git a/Dozentenmodul/bin/GUI/AddOS.class b/Dozentenmodul/bin/GUI/AddOS.class index 4e78b39c..a2e9dc07 100644 Binary files a/Dozentenmodul/bin/GUI/AddOS.class and b/Dozentenmodul/bin/GUI/AddOS.class differ diff --git a/Dozentenmodul/bin/GUI/AddSoftware$1.class b/Dozentenmodul/bin/GUI/AddSoftware$1.class index a6d39c7c..cd6f0364 100644 Binary files a/Dozentenmodul/bin/GUI/AddSoftware$1.class and b/Dozentenmodul/bin/GUI/AddSoftware$1.class differ diff --git a/Dozentenmodul/bin/GUI/AddSoftware$2.class b/Dozentenmodul/bin/GUI/AddSoftware$2.class index ffee99c1..a4b65d07 100644 Binary files a/Dozentenmodul/bin/GUI/AddSoftware$2.class and b/Dozentenmodul/bin/GUI/AddSoftware$2.class differ diff --git a/Dozentenmodul/bin/GUI/AddSoftware.class b/Dozentenmodul/bin/GUI/AddSoftware.class index 14f85078..f83d17ed 100644 Binary files a/Dozentenmodul/bin/GUI/AddSoftware.class and b/Dozentenmodul/bin/GUI/AddSoftware.class differ diff --git a/Dozentenmodul/bin/GUI/EingabeSystemDaten$1.class b/Dozentenmodul/bin/GUI/EingabeSystemDaten$1.class index 64af4539..0d82d498 100644 Binary files a/Dozentenmodul/bin/GUI/EingabeSystemDaten$1.class and b/Dozentenmodul/bin/GUI/EingabeSystemDaten$1.class differ diff --git a/Dozentenmodul/bin/GUI/EingabeSystemDaten$2.class b/Dozentenmodul/bin/GUI/EingabeSystemDaten$2.class index 400745b2..e1c316f9 100644 Binary files a/Dozentenmodul/bin/GUI/EingabeSystemDaten$2.class and b/Dozentenmodul/bin/GUI/EingabeSystemDaten$2.class differ diff --git a/Dozentenmodul/bin/GUI/EingabeSystemDaten$3.class b/Dozentenmodul/bin/GUI/EingabeSystemDaten$3.class index b654a5d9..9f289a12 100644 Binary files a/Dozentenmodul/bin/GUI/EingabeSystemDaten$3.class and b/Dozentenmodul/bin/GUI/EingabeSystemDaten$3.class differ diff --git a/Dozentenmodul/bin/GUI/EingabeSystemDaten.class b/Dozentenmodul/bin/GUI/EingabeSystemDaten.class index 12cfba6b..452b9830 100644 Binary files a/Dozentenmodul/bin/GUI/EingabeSystemDaten.class and b/Dozentenmodul/bin/GUI/EingabeSystemDaten.class differ diff --git a/Dozentenmodul/bin/sql/sql.class b/Dozentenmodul/bin/sql/sql.class index c329e52e..f000a43f 100644 Binary files a/Dozentenmodul/bin/sql/sql.class and b/Dozentenmodul/bin/sql/sql.class differ diff --git a/Dozentenmodul/src/GUI/AddOS.java b/Dozentenmodul/src/GUI/AddOS.java index 5039a4e1..045031bd 100644 --- a/Dozentenmodul/src/GUI/AddOS.java +++ b/Dozentenmodul/src/GUI/AddOS.java @@ -124,6 +124,7 @@ public class AddOS extends JDialog { } Connection con=sql.getConnection(); sql.AddOS(con, textField_1.getText().toString(), textField_2.getText().toString(), comboBox.getSelectedItem().toString(), Kosten, textField.getText().toString()); + dispose(); } }); okButton.setActionCommand("OK"); diff --git a/Dozentenmodul/src/GUI/AddSoftware.java b/Dozentenmodul/src/GUI/AddSoftware.java index c3a41227..c04c5012 100644 --- a/Dozentenmodul/src/GUI/AddSoftware.java +++ b/Dozentenmodul/src/GUI/AddSoftware.java @@ -31,7 +31,7 @@ public class AddSoftware extends JDialog { /** * Launch the application. */ - public static void main(String[] args) { + /*public static void main(String[] args) { try { AddSoftware dialog = new AddSoftware(); dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); @@ -39,7 +39,7 @@ public class AddSoftware extends JDialog { } catch (Exception e) { e.printStackTrace(); } - } + }*/ /** * Create the dialog. @@ -124,7 +124,9 @@ public class AddSoftware extends JDialog { } Connection con=sql.getConnection(); sql.AddSoftware(con, textField_1.getText().toString(), textField_2.getText().toString(), comboBox.getSelectedItem().toString(), Kosten, textField.getText().toString()); + dispose(); } + }); okButton.setActionCommand("OK"); buttonPane.add(okButton); diff --git a/Dozentenmodul/src/GUI/EingabeSystemDaten.java b/Dozentenmodul/src/GUI/EingabeSystemDaten.java index 9e370328..4a70d4b3 100644 --- a/Dozentenmodul/src/GUI/EingabeSystemDaten.java +++ b/Dozentenmodul/src/GUI/EingabeSystemDaten.java @@ -177,6 +177,7 @@ public class EingabeSystemDaten extends JDialog { public void actionPerformed(ActionEvent arg0) { AddOS os=new AddOS(); os.setVisible(true); + } }); btnHinzufgen.setBounds(326, 372, 118, 23); diff --git a/Dozentenmodul/src/sql/sql.java b/Dozentenmodul/src/sql/sql.java index 35e09615..813900cc 100644 --- a/Dozentenmodul/src/sql/sql.java +++ b/Dozentenmodul/src/sql/sql.java @@ -19,7 +19,7 @@ public class sql { e.printStackTrace(); } try { - Connection con=DriverManager.getConnection("jdbc:mysql://132.230.4.16/bwLehrpool?user=root&password=12wil$on"); + Connection con=DriverManager.getConnection("jdbc:mysql://132.230.4.16/bwLehrpool?user=bwlpuser&password=armag3ddon"); return con; } catch (SQLException e) { // TODO Auto-generated catch block @@ -34,7 +34,7 @@ public class sql { Statement stm; try { stm = con.createStatement(); - return stm.executeQuery("SELECT distinct Produktname, Version, Architektur FROM bwlehrpool.betriebssystem order by Produktname asc;"); + return stm.executeQuery("SELECT distinct Produktname, Version, Architektur FROM bwLehrpool.Betriebssystem order by Produktname asc;"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); @@ -55,7 +55,7 @@ public class sql { { addHersteller(con, Hersteller); } - int ret=stm.executeUpdate("INSERT INTO `bwlehrpool`.`betriebssystem`(`Produktname`,`Version`,`Architektur`,`IstKostenlos`,`SWHersteller_pk`)VALUES('"+name+"','"+Version+"','"+Architektur+"',"+Kosten+","+pk_Hersteller+");"); + int ret=stm.executeUpdate("INSERT INTO `bwLehrpool`.`Betriebssystem`(`Produktname`,`Version`,`Architektur`,`IstKostenlos`,`SWHersteller_pk`)VALUES('"+name+"','"+Version+"','"+Architektur+"',"+Kosten+","+pk_Hersteller+");"); return ret; } catch (SQLException e) { // TODO Auto-generated catch block @@ -103,8 +103,8 @@ public class sql { int ret=-1; try { stm=con.createStatement(); - ret=stm.executeUpdate("INSERT INTO `bwlehrpool`.`swhersteller`(`Name`)VALUES('"+Name+"');"); - con.commit(); + ret=stm.executeUpdate("INSERT INTO `bwLehrpool`.`SWHersteller`(`Name`)VALUES('"+Name+"');"); + //con.commit(); } catch (SQLException e) { // TODO Auto-generated catch block @@ -166,7 +166,7 @@ public class sql { { addHersteller(con, Hersteller); } - int ret=stm.executeUpdate("INSERT INTO `bwlehrpool`.`software`(`Produktname`,`Version`,`Architektur`,`IstKostenlos`,`SWHersteller_pk`)VALUES('"+name+"','"+Version+"','"+Architektur+"',"+Kosten+","+pk_Hersteller+");"); + int ret=stm.executeUpdate("INSERT INTO `bwLehrpool`.`Software`(`Produktname`,`Version`,`Architektur`,`IstKostenlos`,`SWHersteller_pk`)VALUES('"+name+"','"+Version+"','"+Architektur+"',"+Kosten+","+pk_Hersteller+");"); return ret; } catch (SQLException e) { // TODO Auto-generated catch block -- cgit v1.2.3-55-g7522