PERTEMUAN 7.

Slides:



Advertisements
Similar presentations
1ide Studio | Workshop Design Graphis, Foto, Video| Mendesain In terface Video Player.
Advertisements

For(int i = 1; i
Mengatur Pages. 1. Ketik alamat Admin Wordpress di Browser
Seksyen A Seksyen A Pelajaran 5 : Pengenalan Kepada Anti Virus Trend Micro.
19 augustus 2003augustus 2003 JSP-2. BICT 2JDBC BICT 3Install MySQL Download MySQL daemon – Free – Windows version… Start Daemon – Mysqld-nt.exe Download.
Server-Side Scripting with Java Server Page, JSP.
Java, Access, SQL, HTML. Three-tier architecture involves: Client - Browser Server - Tomcat Database - Access - Server-side language - JSP could just.
14 1 Chapter 14 Database Connectivity and Web Development Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
1 Pertemuan 11 Aplikasi Web dengan Servlet dan JSP Matakuliah: T0053/Web Programming Tahun: 2006 Versi: 2.
JDBC Java API for Database Connectivity. Layout of this recitation Introduction to JDBC API JDBC Architecture Understanding the design of JDBC API –Classes.
TUTORIAL (1) Software installation Written by: Eng. Ahmed Mohamed Abdel Ghafar, Edited by Eng. Muhammed Hammad, Eng. Hamdy Soltan & Eng. Osama Talaat.
UFCE4Y UFCE4Y-20-3 Components and Services Julia Dawson.
JDBC. What is JDBC JDBC is an acronym for –Java Data Base Connectivity. It allows java/jsp program to connect to any database.
JDBC. JDBC Drivers JDBC is an alternative to ODBC and ADO that provides database access to programs written in Java.
Java + XML. Java 2 Enterprise Edition Server Side java Servlets JSP JavaBeans Web Services Database jdbc.
JSP Presented by K.Venkata Ratnam HOD MCA (Dept) Newton’s Institute of Engineering.
JDBC Enterprise Systems Programming. JDBC  Java Database Connectivity  Database Access Interface provides access to a relational database (by allowing.
Using Mail Merge.. Step by step.. The advantages by using mail merge application.
作業一 Using DBMS ( 使用 DB2) C. J. Date 課本習題 4.1~4.6 Ex. 4.5, 4.6 程式作業要使用 Embedded SQL 連結 DB2. EX (p ) Using the suppliers-parts-projects database,
JDBC CS 124. JDBC Java Database Connectivity Database Access Interface provides access to a relational database (by allowing SQL statements to be sent.
Java and Databases. JDBC Architecture Java Application JDBC API Data Base Drivers AccessSQL Server DB2InformixMySQLSybase.
Administrasi Server Load Balancing. Load Balancing Load balancing means the ability to spread the load of processing for an application over a number.
JDBC Java DataBase Connectivity. Loading the driver import java.sql.*... Class.forName("org.postgresql.Driver")‏
Advanced Java Session 5 New York University School of Continuing and Professional Studies.
Source Page US:official&tbm=isch&tbnid=Mli6kxZ3HfiCRM:&imgrefurl=
1 Principles of Database Systems With Internet and Java Applications Today’s Topic Chapter 8: Applications Programming for Relational Databases Instructor’s.
1 Download current version of Tomcat from: g/tomcat/ g/tomcat/ Install it in: C:\Program Files\Apache.
Java Database Connectivity JDBC. Open Database Connectivity developed by Microsoft to provide interaction with databases using SQL. Use the JDBC-ODBC.
JDBC Statements The JDBC Statement, CallableStatement, and PreparedStatement interfaces define the methods and properties that enables to send SQL or PL/SQL.
JDBC. What is JDBC JDBC is an acronym for –Java Data Base Connectivity. It allows java program to connect to any database.
Путешествуй со мной и узнаешь, где я сегодня побывал.
JSP java server pages.
Java Class and Servlet ISYS 350.
Pertemuan #5 Java Language Fundamental
J2EE (Enterprise Programing)
INSTALL OJS Ajie Noorseto.
CodeIgniter Form & Login
Web Programming: If Statement and Servlet
PERTEMUAN 3.
PERTEMUAN 2.
Net-centric Computing
Introduction to HTML Forms and Servlets
Pertemuan ke 13 Input dan cari.
JDBC & Servlet CSE 4504/6504 Lab.
PERTEMUAN 5.
The J2EE Framework Java Technologies External Application.
DATABASE IN JAVA.
PHP Overview PHP: Hypertext Preprocessor Server-Side Scripting
Page 1. Page 2 Page 3 Page 4 Page 5 Page 6 Page 7.
Assignment help PHP + MySQL crash course
Server-Side Scripting with Java Server Page, JSP
Intro to PHP at Winthrop
SERVLETS AND JDBC.
Database Processing with JSP
Servlets.
Servlets CEN /28/2018 Copyright 2001 Ege Consulting, Inc.
Database Connectivity and Web Development
Java Servlet ISYS 350.
Servlets.
Cookie and Session Bayu Priyambadha, S.Kom.
JDBC Example.
Java Servlets Servlet Overview Servlets and HTML Forms Servlet Basics
Multivalued parameters
Multivalued parameters
ZOTERO Diah Hari Suryaningrum. Open Browser: ZOTERO.
Assignment help PHP + MySQL crash course
COSC 2956 Internet Tools Java Server Pages.
Retrieving All parameters when names are not known
Web Forms.
Presentation transcript:

PERTEMUAN 7

Edit Data Database Langkah-langkah : FormEdit.html CodingEdit.jsp Ubah ke servlet menggunakan Deploy Tool (masukkan ke dalam context root pertemuan sebelumya) Cek di Browser

Buat formEdit.html FORM EDIT DATA NIM : Nama Alamat txtNim txtNama txtAlamat Simpan simpan

FormEdit.jsp(1) <%@ page import="java.sql.*"%> <% String nim=request.getParameter("nim"); String nama=null; String alamat=null; Connection conn=null; ResultSet rs=null; Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); conn=DriverManager.getConnection("jdbc:odbc:mahasiswa","root",""); PreparedStatement pstmt=null; String query=null; query="select * from tb_mahasiswami where nim=?"; pstmt=conn.prepareStatement(query); pstmt.setString(1,nim); rs=pstmt.executeQuery();

FormEdit.jsp(2) if (rs.next()){ out.println("<form action='codingEdit.jsp' method='post'>"); out.println("<center>TAMBAH DATA<center>"); out.println("<table align='center' border='0'>"); out.println("<tr><td>NIM</td><td>:</td><td><input type='text' name='txtNim' value='"+nim+"'></td></tr>"); out.println("<tr><td>Nama</td><td>:</td><td><input type='text' name='txtNama' value='"+rs.getString("nama")+"'></td></tr>"); out.println("<tr><td>Alamat</td><td>:</td><td><input type='text' name='txtAlamat' value='"+rs.getString("alamat")+"'></td></tr>"); out.println("<tr><td></td><td></td><td><input type='submit' value='Edit'></td></tr>"); out.println("</form>"); } %>

CodingEdit.jsp (1) <%@ page import="java.sql.*"%> <% String nim=request.getParameter(“txtnim"); String nama=request.getParameter(“txtnama"); String alamat=request.getParameter(“txtalamat"); Connection conn=null; ResultSet rs=null; Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); conn=DriverManager.getConnection("jdbc:odbc:mahasiswa","root",""); PreparedStatement pstmt=null; String query=null; query="UPDATE tb_mahasiswami SET nama=?, alamat=? WHERE nim=?";

CodingEdit.jsp (2) pstmt=conn.prepareStatement(query); pstmt.setString(1,nama); pstmt.setString(2,alamat); pstmt.setString(3,nim); int hasil=pstmt.executeUpdate(); if (hasil==1) out.println("Edit Data Berhasil"); else out.println("Edit Data Gagal"); %> <form method="post" action="tampil.jsp"> <center><input type=submit value=Kembali></center> </form>