Teori Hapus Teori Edit Form

298

2.54 Teori Hapus

Halaman Teori Hapus akan muncul ketika admin menekan button “Hapus” pada data yang akan dihapus. Pada halaman ini sistem akan menampilkan pesan “Teori Berhasil Dihapus”. Gambar Halaman Teori Hapus Berikut ini potongan listing program bagian proses hapus Teori. td headers=hapus center a href=TeoriHapus.jsp?nama_te== album.getNama_teimg src=imageshps.png alt=cgerak width=20 height=20acentertdtr } String dbConnErrMsg = null; } catch SQLException sqle { dbConnErrMsg = sqle.getMessage; } finally { album.release; } tablebrbrtable Query tampilTeori : public void tampilTeori throws SQLException { if conn == null { conn = getConnection; } stmt = OraclePreparedStatement conn.prepareStatement select from teori order by jenis_te; rset = OracleResultSet stmt.executeQuery; } String id = request.getParameterid_te; try { album.selectTable; album. deleteMateri id; int rowCount = 0; while album.fetch { rowCount++; } 299

2.55 Teori Edit Form

Halaman Teori Edit Form akan muncul ketika user memilih button gambar “Edit” pada data. Pada halaman ini akan menampilkan form terdiri dari kolom yang berisi data Teori yang dipilih. Gambar Halaman Teori Edit Berikut ini potongan listing program halaman TeoriEditForm. String dbConnErrMsg = null; } catch SQLException sqle { dbConnErrMsg = sqle.getMessage; } finally { album.release; } div meta http-equiv=refresh content=2;url=MateriTampil.jsp center p font size=3 color=000000 bData Teori berhasil dihapusb brimg src=imageshap.png width=100 height=100 fontp center Query deleteMateri : public void deleteMateriString selectId throws SQLException { if conn == null { conn = getConnection; } stmt = OraclePreparedStatement conn.prepareStatement delete from teori where nama_te = ?; stmt.setString1, selectId; rset = OracleResultSet stmt.executeQuery; } String id = request.getParameterid_te; String media = request.getParametermedia; if id = null || media = null { try { album.selectRowByIdid; if album.fetch { response.setStatusresponse.SC_NOT_FOUND; return; 300

2.56 Teori Edit Proses