From 1eb34f1717689677a5d91402e52028ab87dfedb6 Mon Sep 17 00:00:00 2001 From: Auliya Aqma Dinillah Date: Tue, 31 Oct 2017 10:18:25 +0700 Subject: [PATCH] list di dropdown sudah dari DB --- web/Admin-Panel/Location/index.jsp | 119 ++++++++++++++++++++--------- 1 file changed, 81 insertions(+), 38 deletions(-) diff --git a/web/Admin-Panel/Location/index.jsp b/web/Admin-Panel/Location/index.jsp index 0e9c959..7127000 100644 --- a/web/Admin-Panel/Location/index.jsp +++ b/web/Admin-Panel/Location/index.jsp @@ -4,6 +4,11 @@ Author : Alpin J --%> + +<%@page import="java.sql.ResultSet"%> +<%@page import="java.sql.Statement"%> +<%@page import="java.sql.Connection"%> +<%@page import="java.sql.DriverManager"%> <%@page contentType="text/html" pageEncoding="UTF-8"%> @@ -46,11 +51,9 @@
@@ -68,13 +71,44 @@

List Of Location

- + + <% + try + { + String Query="select * from province"; + Class.forName("com.mysql.jdbc.Driver").newInstance(); + Connection conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/travlendardb","root",""); + Statement stm=conn.createStatement(); + ResultSet rs=stm.executeQuery("select distinct PROVINCE_CODE, PROVINCE_NAME from province"); + while(rs.next()) + { + + %> + + <% + out.println("KODE : " + rs.getString("PROVINCE_CODE")); + + } + // conn.close(); + // rs.close(); + } + catch (Exception ex) + { + ex.printStackTrace(); + out.println("Error" + ex.getMessage()); + } + + %> + +