<% Blob image = null; Connection con = nul" name="description">

fat image from db

Ads
 

fat image from db

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

<%@ page import="java.io.*"%> <%
Blob image = null; Connection con = null; byte[] imgData = null ; Statement stmt = null; ResultSet rs = null;

<%
        Class.forName("com.mysql.jdbc.Driver");
        con = DriverManager.getConnection("jdbc:mysql://localhost:3306/employee","root","");
        stmt = con.createStatement();
        rs = stmt.executeQuery("select image from regimg where id ='45'");
        if (rs.next()) {
          image = rs.getBlob(1);
     imgData = image.getBytes(1,(int)image.length());
          int bufferSize = 1024;
          byte[] buffer = new byte[bufferSize];
     response.setContentType("image/jpg");
    OutputStream o = response.getOutputStream();
o.write(imgData);

%>

sir i want to display within tag please help me

View Answers

Ads









Related Tutorials/Questions & Answers:
fat image from db
fat image from db   <%@ page import="java.sql.*"%> <%@ page import="java.io.*"%> <% Blob image = null... = stmt.executeQuery("select image from regimg where id ='45'"); if (rs.next
fat image from db
fat image from db   <%@ page import="java.sql.*"%> <%@ page import="java.io.*"%> <% Blob image = null... = stmt.executeQuery("select image from regimg where id ='45'"); if (rs.next
Advertisements
fat image from db
fat image from db   <%@ page import="java.sql.*"%> <%@ page import="java.io.*"%> <% Blob image = null... = stmt.executeQuery("select image from regimg where id ='45'"); if (rs.next
fat image from db
fat image from db   <%@ page import="java.sql.*"%> <%@ page import="java.io.*"%> <% Blob image = null... = stmt.executeQuery("select image from regimg where id ='45'"); if (rs.next
Store image from html img tag into mysql db using java
Store image from html img tag into mysql db using java  Hi. How to get the image displayed in the < img > tag of HTML and store it in the mysql database using java? Thanks in advance
retrieving image from mysql db with standard height and width
retrieving image from mysql db with standard height and width  Hi . Here is my code to retrieve an image from mysql db. Its working properly. But i... = con.prepareStatement("select * from image"); ResultSet rs=pre.executeQuery
retrieving image from mysql db with standard height and width
retrieving image from mysql db with standard height and width  Hi . Here is my code to retrieve an image from mysql db. Its working properly. But i... = con.prepareStatement("select * from image"); ResultSet rs=pre.executeQuery
JSP:select image for db and display in image tag
JSP:select image for db and display in image tag  Hi, i am new to this forum. My query is that, i am trying to display image in image tag but i am...(); response.setContentType("image/jpg"); response.getOutputStream().write(rb,0,len
JSP:select image for db and display in image tag
JSP:select image for db and display in image tag  Hi, i am new to this forum. My query is that, i am trying to display image in tag but i am...(); response.setContentType("image/jpg"); response.getOutputStream().write(rb,0,len
JSP:select image for db and display in image tag
JSP:select image for db and display in image tag  Hi, i am new to this forum. My query is that, i am trying to display image in tag but i am...(); response.setContentType("image/jpg"); response.getOutputStream().write(rb,0,len
getting coords from an image.
getting coords from an image.  how to get coordinates dynamically(in run time) from an image?? pls help me
Fetching image from database
Fetching image from database  I have uploaded image path and image name in database so, now how can i display that image using JSP or HTML page(is it possible to display using tag using concatination). image path i have stored
Saving image and text in mysql db using spring?
Saving image and text in mysql db using spring?  Hii, My requirement is to save the employee details(including image) into mysql db.i want to save the image location in db .And actual image(binary formate) should save
View Photo From Db MySql
View Photo From Db MySql  Good Morning Sir, Please help me, I make a small code but i have a error. I want to make viewer photo from database...(); ResultSet res = stat.executeQuery("select * from kar where nik
How to retrieve image from database
How to retrieve image from database  hi........ How to retrieve image from database when it is stored. I have stored image in postgresql and want... but it retrieves as a string and not complete image can u tel me the conversion
same thing i want but from db..
same thing i want but from db..  http://www.roseindia.net/tutorial/javascript/dynamicCombo.html same thing i want but from db
Insert Image In DB through Servlet - JSP-Servlet
Insert Image In DB through Servlet  Dear Sir, My previous Query...()); pstmt.executeUpdate(); System.out.println("Successfully display image from database ....."); ResultSet rs=stmt.executeQuery("select * from Image where
store and retrive image from the database
store and retrive image from the database  please provide me... to store and retreive images from sql database using sql commands -how to store and retreive images from sql database using asp.net/c# thanks in advance
Java image query from Rupesh
Java image query from Rupesh  who give web page link to any submenu in menu bar of screen in java so that after click on that submenu, this submenu direct link to web brower or web page
how to fetch image from mysql using jsp
how to fetch image from mysql using jsp  how to fetch image from mysql using jsp
to upload a table from DB to the same html page
to upload a table from DB to the same html page  how to make this booklist table to be opened in the same html page itself using a third frame
store & retrive the image from oracle database
store & retrive the image from oracle database  how can i store the image path in tha database & fetch that image from oracle database
retrieving from db - JSP-Servlet
retrieving from db  hello' I am trying to write my first application...: rst=stmt.executeQuery("select * from books_details"); 27: %> 28...; Hi Retrive value from database Retrive data from
How to store and retrieve image from database in JSP?
How to store and retrieve image from database in JSP?  Hi, In one... and retrieve image from database in JSP? Thanks   HI, You can use... the image. Check this example: Retrieve image from database using Servlet. Thanks
Retrieving the Image from a database Table
Retrieving the Image from a database Table Consider a case where we want... to retrieve the image from the database table. You can do it very easily after... the image from the database table in prepareStatement() method of the Connection
image upload with jsp from form
image upload with jsp from form  hi i used the code specified in your following post http://www.roseindia.net/answers/viewqa/JSP-Servlet/9749-image-upload-and-stored-in-database.html but i am getting following error
retrieving info from DB using struts?
retrieving info from DB using struts?  Hi. I was looking info about retrieving info from a database using struts. I need a .java that I suppose connects to a database and show the info on a jsp. Somebody could help me
How to access data yearly from DB in C# ?
How to access data yearly from DB in C# ?  how to access data yearly from database in C#. I have code but i m not able to retrieve data yearly from DB table. string date1 = dateTimePicker1.Value.Date.ToString("dd/MMM/yyyy
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 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 SQL query to find the data from database and get the image from resultset using
ModuleNotFoundError: No module named 'fat'
ModuleNotFoundError: No module named 'fat'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'fat' How to remove the ModuleNotFoundError: No module named 'fat' error

Ads