Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@page import = "javax.servlet.*"%>
- <%@page import="java.sql.*"%>
- <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
- pageEncoding="ISO-8859-1"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Insert title here</title>
- </head>
- <body>
- <%
- try{
- Class.forName("com.mysql.jdbc.Driver");
- }catch(Exception e){}
- try{
- Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/jeet","root","jeet");
- Statement stmt = con.createStatement();
- ResultSet rs = stmt.executeQuery("select * from jeet");
- while(rs.next()){%>
- <table>
- <tr>
- <td>
- <%
- rs.getInt("id");
- %>
- </td>
- <td>
- <%
- rs.getString("bname");
- %>
- </td>
- <td>
- <%
- rs.getString("author");
- %>
- </td>
- <td>
- <%
- rs.getInt("price");
- %>
- </td>
- </tr>
- </table>
- <%}
- }catch(Exception e){
- }
- %>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement