" name="description">

how to retrieve text and images from mysql database and show on html page using jsp servlet

Ads
 

how to retrieve text and images from mysql database and show on html page using jsp servlet

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> Insert title here

<%@ page import="java.sql.*" %> <%@ page import="javax.sql.*" %> <%@ page import="java.io.*" %> <%

Blob image = null; byte[] imgData = null ; String userid=request.getParameter("usr"); //session.putValue("user",userid); String pwd=request.getParameter("pwd"); String a="faiztechno"; String b="ziaf1234"; if(userid.equals(a) && pwd.equals(b))

out.println("LOGIN SUCCESS, WELCOME ADMIN");

else { response.sendRedirect("login2.html"); //out.println("you are not an admin, please register"); } %>

Home

User Complaints:

<% Class.forName("com.mysql.jdbc.Driver"); java.sql.Connection con=DriverManager.getConnection( "jdbc:mysql://localhost:3306/faiz","root","ziaf1234"); Statement st=con.createStatement(); //out.println("hello"); //ResultSet rs=st.executeQuery("select * from users where userid='"+userid+"'"); ResultSet rs = st.executeQuery("select * from complainttable"); %> <% while (rs.next()) { %> <% //out.println("
") ; //out.print(rs.getString(1)); } %>

Complaint Timing

User Name

Complaint Details

Complaint Images

<%out.print(rs.getString(1)); %> <%out.print(rs.getString(2)); %> <%out.print(rs.getString(3)); %> click <% image = rs.getBlob(4); imgData = image.getBytes(1,(int)image.length()); OutputStream o = response.getOutputStream(); o.write(imgData); %>

View Answers

Ads









Related Tutorials/Questions & Answers:
how to retrieve text and images from mysql database and show on html page using jsp servlet
how to retrieve text and images from mysql database and show on html page using jsp servlet  <%@ page language="java" contentType="text/html... {color:blue} <%@ page import="java.sql.*" %> <%@ page import
how to retrieve image from mysql database using java and show it in HTML img tag ?
how to retrieve image from mysql database using java and show it in HTML img tag ?  how to retrieve image from mysql database using java and show it in HTML img tag
Advertisements
How to retrieve image from database using jsp and servlet?
How to retrieve image from database using jsp and servlet?  Hi, I am trying to find code for displaying the image from database in a JSP page. How to retrieve image from database using jsp and servlet
how to retrieve images from database to jsp?
how to retrieve images from database to jsp?  Hi sir,i want to stores images along with the name and price with database and retrieve it on jsp.and... urgent.   1)images: <%@ page import="java.sql.*,java.io.*,java.util.
How to retrieve image from mysql database in JSP?
How to retrieve image from mysql database in JSP?  Hi, I need JSP... to retrieve image from mysql database in JSP? Thanks   Hi, You can write... images from Database in JSP. Thanks
how to store and retrieve images int and from the database using php
how to store and retrieve images int and from the database using php  please anyone can help me in storing the images and retrieve it back from the Mysql database using php
how to display image and text in single jsp page from the mysql database
how to display image and text in single jsp page from the mysql database  hello please help me to display the image and text in single jsp page from mysql database if have any reference code please send me Thanks in advance
Retrieve image from database using servlet and display in JSP
to use MySQL Database from JSP page. How to retrieve image from database using servlet and display in JSP? Thanks...Retrieve image from database using servlet and display in JSP  Hi, I
how to show effect (visual) on jsp page using value from database
how to show effect (visual) on jsp page using value from database  I am making a ticket booking system. I have a databse with a clumn "booking status... is "not_booked" then the picture shown as seat should be displayed red. Also i dont know how
Retrieve database from the table dynamically in jsp from oracle using servlet
using java servlet from the database in the jsp page...Retrieve database from the table dynamically in jsp from oracle using servlet  Sir, I have created a table in oracle using eclipse, and added few
how to retrieve data from database using combobox value without using request.getParameter in jsp - JSP-Servlet
how to retrieve data from database using combobox value without using request.getParameter in jsp  Answer pl
retrieve related data from database using jsp and mysql
retrieve related data from database using jsp and mysql  Hi sir, please give some example of jsp code for retrieving mysql database values... be shown in the adjacent text field. Regards banajit
how to upload an image from a jsp page to a mysql database table using jsp
how to upload an image from a jsp page to a mysql database table using jsp  how to upload an image from a jsp page to a mysql database table using jspstrong text
Fetched Record from database show into text field of html page
Fetched Record from database show into text field of html page  hi, i..., and also have html page with all above mentioned field i have submit 20 record from front end of html file to my database like that 001 sajal Noida North 002
How To Store Multilple Images In MySQL database dynamically with image uploader and then retrieve them in image gallery using java
How To Store Multilple Images In MySQL database dynamically with image uploader and then retrieve them in image gallery using java  How To Store Multilple Images In MySQL database dynamically with image uploader
How to get the text from textarea in HTML and store it in database using javascript and jsp
How to get the text from textarea in HTML and store it in database using javascript and jsp  How to get the text from textarea in HTML and store it in database using javascript and jsp <script> function str() { <
How to retrieve data from database by using combo box value in jsp? - JSP-Servlet
How to retrieve data from database by using combo box value in jsp?  Hello friend i want use only one jsp page.. but u give 2 pages... I want to work in one page... Pl response.. I do not need getParameter... Pl respose me
retrive the employee details with image from mysql database using jsp servlet
retrive the employee details with image from mysql database using jsp... stored in the database using jsp servlet then want to show the result in the next jsp page. any one help me out
How to display image in jsp from database using Servlet?
How to display image in jsp from database using Servlet?  Hi, How to display image in jsp from database using Servlet? Thanks   Hi, You will find code and example program at Retrieve image from database using Servlet
How to retrieve image from database in Servlet?
How to retrieve image from database in Servlet?  Hi, How to retrieve image from database in Servlet? Thanks   Hi, Please check the tutorial Retrieve image from database using Servlet. Thanks
How to retrieve blob image from database in JSP?
How to retrieve blob image from database in JSP?  Hello, JSP is used... the blog image from database. How to retrieve blob image from database in JSP?   Hi, Please check the tutorial Retrieve image from database using
How to store and retrieve image from database in JSP?
How to store and retrieve image from database in JSP?  Hi, In one... the image. Check this example: Retrieve image from database using Servlet. Thanks... and retrieve image from database in JSP? Thanks   HI, You can use
Retrieve image from mysql database through jsp
Retrieve image from mysql database through jsp... to retrieve image from mysql database through jsp code. First create a database.... mysql> create database mahendra; Note : In the jsp code given below, image
How to Autogenerate of ID from database and show on JSP page?
How to Autogenerate of ID from database and show on JSP page?  ... tasks id as primay key, I am using JSP and struts for database connectivity,Now I..." prefix="html"%><%@ page contentType="text/html;charset=windows-1252"%>
How to Autogenerate of ID from database and show on JSP page?
How to Autogenerate of ID from database and show on JSP page?  ... tasks id as primay key, I am using JSP and struts for database connectivity,Now I..." prefix="html"%><%@ page contentType="text/html;charset=windows-1252"%>
How to Autogenerate of ID from database and show on JSP page?
How to Autogenerate of ID from database and show on JSP page?  ... tasks id as primay key, I am using JSP and struts for database connectivity,Now I..." prefix="html"%><%@ page contentType="text/html;charset=windows-1252"%>
How to Autogenerate of ID from database and show on JSP page?
How to Autogenerate of ID from database and show on JSP page?  ... tasks id as primay key, I am using JSP and struts for database connectivity,Now I... uri="/WEB-INF/struts-html.tld" prefix="html"%><%@ page contentType="text
How to show database values into graph using jsp?
How to show database values into graph using jsp?  How to show database values into graph using jsp
How to show database values into graph using jsp?
How to show database values into graph using jsp?  How to show database values into graph using jsp
How to pass parametes from JSP page to HTML page? - JSP-Servlet
How to pass parametes from JSP page to HTML page?  Hi all, In my project I have one JSP page and one HTML page. In JSP page I have created HTML... to pass the values from my JSP page to HTML page. Pls help me out. Hitendra 
Retrieve image from database using Servlet
Retrieve image from database using Servlet       In this example we will show you how to develop a Servlet that connects to the MySQL database and retrieves the image from the table. After

Ads