public void TableUPdate(){ String sql = "select * from Employee"; try{ pst = conn.prepareStatement(sql); rs = pst.executeQuery(); while(rs.next()){ Ecode = rs.getString("E_Code"); Ename = rs.getString("E_Name"); Secid = Integer.parseInt(rs.getString("Sec_Id")); Posid = Integer.parseInt(rs.getString("Pos_Id")); Statusid = Integer.parseInt(rs.getString("Status_Id")); String sql2 = "select * from Department where Sec_Id="+Secid+""; pst = conn.prepareStatement(sql2); rs = pst.executeQuery(); Secname = rs.getString("Sec_Name"); model.addRow(new Object[]{Ecode, Ename, Secname, Posname, Statusname}); } }catch (Exception e){ JOptionPane.showMessageDialog(null, e); } }
String sql = "select Employee.E_Code, Employee.E_Name, Department.Sec_Name from Employee Inner Join Department On Employee.Sec_Id = Department.Sec_Id";
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง