Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JSP-Servlet to get picture from ms access database by jsp-servlet....

Have Programming Question? Ask it here!
 
 
 


sanatankumar
to get picture from ms access database by jsp-servlet....
1 Answer(s)      3 years and 2 months ago
Posted in : JSP-Servlet


I have inserted a picture in ms access data base,,,how we can retrieve that picture by using jsp.......


Advertisement
View Answers

March 10, 2011 at 10:33 AM


<%@page import="java.sql.*,java.io.*"%>
<%
try{
    InputStream sImage;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
           Connection con = DriverManager.getConnection("jdbc:odbc:student");
File imgfile = new File("C:/rose.jpg");
      FileInputStream fin = new FileInputStream(imgfile);
      PreparedStatement pre = con.prepareStatement("insert into user(name,address,image) values(?,?,?)");
      pre.setString(1,"A");
      pre.setString(2,"Delhi");
      pre.setBinaryStream(3,fin,(int)imgfile.length());
      pre.executeUpdate();
     out.println("Inserting Successfully!");
      pre.close();
      Statement st=con.createStatement();
      ResultSet rs=st.executeQuery("SELECT image FROM user WHERE id = 3");
      if(rs.next()) {
byte[] bytearray = new byte[1048576];
int size=0;
sImage = rs.getBinaryStream(1);
response.reset();
response.setContentType("image/jpeg");
while((size=sImage.read(bytearray))!= -1 ){
response.getOutputStream().write(bytearray,0,size);
}
}
 con.close();
}     
catch(Exception ex){
out.println("error :"+ex);
}
%>


Related Tutorials/Questions & Answers:
to get picture from ms access database by jsp-servlet....
to get picture from ms access database by jsp-servlet....  I have inserted a picture in ms access data base,,,how we can retrieve that picture by using jsp
How to Open Picture From M.S. Access Database using Java Servlet ?
How to Open Picture From M.S. Access Database using Java Servlet ?  Hi all my Friends I have below code which insert a picture into M.S. Access Database But i m still not able to open this picture through Java using M.S. Access
Advertisements
inserting picture in ms access
inserting picture in ms access  hi i am sanatan, how to insert picture in ms access by jsp.   <%@page import="java.sql.*,java.io.*"%> <% try{ InputStream sImage; Class.forName("sun.jdbc.odbc.JdbcOdbcDriver
MS Access - JSP-Servlet
stepts 1.to configure the ms access database to your system control panel...MS Access  hello sir, i want to use MS.Access as my database..so my problem is how to connect MS Acces database with servlets ... thank you
Updating Ms Access Database using jsp - JSP-Servlet
Updating Ms Access Database using jsp  Hi I am new to jsp and I am trying to update a record in an access database. I only want to update part of the record because the other columns already have data. When I use Update
How to insert or delete records in MS access database using jsp - JSP-Servlet
How to insert or delete records in MS access database using jsp  Hi friends please provide me a solution that i insert or delete record from a database using java server pages. I used the microsoft access 2003 database. PlZ
How save,get picture from database in my jsp page?
How save,get picture from database in my jsp page?  How i save picture in db after browsing it,and also how i get it on my other jsp page
link hibernate to MS ACCESS database
link hibernate to MS ACCESS database  how to link hibernate to ms access database instead of sql database
Java to insert picture to database - JSP-Servlet
Java to insert picture to database  Hi Guys, Please assist me on this. Below is the code I wanted to use to insert picture into Ms Sql server 2000 but after the insertion, I got this in the database (back-end
Migrating from mysql to MS Access
Migrating from mysql to MS Access  Hi I am hoping for some help I need to write a conversion program (SQL statements) to import existing data in a MYSQL database to a MS Access database. any suggestions would be appreciated
jsp or sevlet and html form to send picture to database - JSP-Servlet
that contains his picture to database. What I need are html page for the form that will browse for the picture, jsp or servlet that the info from html will go...jsp or sevlet and html form to send picture to database  Hello guys
how to access the MS ACCESS database with java
how to access the MS ACCESS database with java   how to access the MS ACCESS database with java how can we insert,delete,update,search records of ms access with java   Java MS Access database connectivity Follow
how to delete specified coloumn from database(MS Access) by using windows application
how to delete specified coloumn from database(MS Access) by using windows application  how to delete specified coloumn from database(MS Access) by using c# windows application
how to insert values from jsp into ms access
how to insert values from jsp into ms access   how to insert values using jsp into ms access database
How To Display both image and data into Swing JTable which is retrieved from ms access database
How To Display both image and data into Swing JTable which is retrieved from ms access database  So far this is my code how can i display both image and data from database.. while (rs.next()) { Vector row = new Vector(columns
how to access the MS ACCESS database with java - Java Beginners
how to access the MS ACCESS database with java  how can we insert,delete,update,search records of ms access with java
how to retreive values from MS Access Database based on the values entered in textbox values in jsp file
how to retreive values from MS Access Database based on the values entered... in MS Access Database. the table structure is Sno JobName ProgramName Problem... Solution field from database and display in the textbox of the jsp.   1
how to connect to MS access database in JSP?
how to connect to MS access database in JSP?  how to connect to MS access database in JSP? Any seetings/drivers need to be set or installed before... DSN will get created. 6) Restart your server and run your jsp code. Here is your
how i conditional access the data from database using combo box. - JSP-Servlet
access the data from database when i select class 11 0r 12. Here is JSP file...how i conditional access the data from database using combo box.   i...="+cla+"&&from_year="+y1+"&&to_year="+y2+"&&school="+sch); alert(sch+" "+cla+ " "+y1
How to Validate JRadioButton and How to Save data from JRadioButton to MS Access Database - Java Beginners
How to Validate JRadioButton and How to Save data from JRadioButton to MS Access Database  Hello Sir I want Store Corse Type that contains Two JRadioButton I want Store Information from JRadioButton to MS Access Database, and I
applet connected to table in MS Access database
applet connected to table in MS Access database   i have connected my java code with the MS access database and this is my code, can anyone tell me...:DRIVER={Microsoft Access Driver (*.mdb)};DBQ=faltu.mdb"; // String url = "jdbc
ms access
ms access  how to delete the autonumber from ms access using java delete code
show null point Exception """ while trying 2 load a JComboBox"" data is fetch from database ms-access
from database ms-access  import javax.swing.*; import java.awt....,"connected to database"); stat=con.createStatement(); String ss="select name from data..."); JOptionPane.showMessageDialog(null,"connected to database
show null point Exception """ while trying 2 load a JComboBox"" data is fetch from database ms-access
from database ms-access  import javax.swing.*; import java.awt....,"connected to database"); stat=con.createStatement(); String ss="select name from data..."); JOptionPane.showMessageDialog(null,"connected to database
show null point Exception """ while trying 2 load a JComboBox"" data is fetch from database ms-access
from database ms-access  import javax.swing.*; import java.awt....,"connected to database"); stat=con.createStatement(); String ss="select name from data..."); JOptionPane.showMessageDialog(null,"connected to database
How To Connect MS ACCESS 2003 Database in C Program with Graphics.
How To Connect MS ACCESS 2003 Database in C Program with Graphics.  How To Connect MS ACCESS 2003 Database in C Program with Graphics
Ms Access
Ms Access   How to get query for Primary key from MsAccess?   SELECT column_name FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE table_name = 'data';   SELECT column_name FROM INFORMATION_SCHEMA.KEY_COLUMN
Upload the picture - JSP-Servlet
the picture in the database a webpage and i want to show that picture another page. what i... is a simple example which uploads employee profile data into database and also...://www.roseindia.net/jsp/file_upload/employee_upload_profile_image.shtml Thanks RoseIndia
MS ACCESS
MS ACCESS  i have done : Insert form data into MS database...) Restart your server and run your jsp/servlet code and created a table...-> data sources. 2)Click Add button and select the driver Microsoft Access
MS ACCESS
MS ACCESS  i have done : Insert form data into MS database Follow...) Restart your server and run your jsp/servlet code and created a table...-> data sources. 2)Click Add button and select the driver Microsoft Access
MS ACCESS
MS ACCESS  i have done : Insert form data into MS database...) Restart your server and run your jsp/servlet code and created a table...-> data sources. 2)Click Add button and select the driver Microsoft Access
ACCESS DATABASE FROM HTML
ACCESS DATABASE FROM HTML  I want to access sql 2008 database in html page without help of ADODB connection.. because if access through ADODB means there is a security problem. so, Access database in html page(client side
Get values from JSP pages - JSP-Servlet
Get values from JSP pages  I have welcome.jsp in which it has... to another JSP page?Do you want to use database to add column values or you want... I need to get the value of those column names(First Name, Second
ms access
and password" from my ms access............and detail in register(table in my ms... "username and password" from my ms access............and detail in register(table in my ms access) need to display values in jsp .............please help me
ms access
and password" from my ms access............and detail in register(table in my ms... "username and password" from my ms access............and detail in register(table in my ms access) need to display values in jsp .............please help me
ms access
and password" from my ms access............and detail in register(table in my ms... "username and password" from my ms access............and detail in register(table in my ms access) need to display values in jsp .............please help me
ms access
and password" from my ms access............and detail in register(table in my ms... "username and password" from my ms access............and detail in register(table in my ms access) need to display values in jsp .............please help me
MS access
MS access  how do i access my Ms-Access file placed in the same jar file where my application code/class file r present??? Want to access it via Code. Can anyone help me ? Please give reply urgent...   give me reply
get info from mysql using jsp and servlet
get info from mysql using jsp and servlet  HELLO! I wanna create a jsp page which able to let me get its name, phone and other info by asking the user to key in their email address from mysql database by using servlet and jsp too
HTML(Registration form) to Jsp to stored into MS ACCESS database
HTML(Registration form) to Jsp to stored into MS ACCESS database  i am sending one html file that contain 18 fields these are stored in ms-access database by using jsp code.i want to urgent jsp code. please urgent sir. thank
how to get data from checkboxes - JSP-Servlet
how to get data from checkboxes  hi, i got list of tables on screen... need to get only those tables to the next page where i can get list of columns to that selected tables. please help me.  hi, we can get the selected
to fetch data from ms word and storing into database
to fetch data from ms word and storing into database  i want to know how to fetch datafields from ms word and storing into database??? please answer soon .its urgent
how to get a values from processRecord - JSP-Servlet
how to get a values from processRecord  dear sir, i have a problem in getting a values from java to jsp.Here jsp is used to read a excel sheet...... thanks in advance.. //in jsp FileInputStream fin = new FileInputStream
MS-Access
MS-Access  I am trying to upload a image to ms-acess using jsp,and my problem is that it shows some error int the browser that "java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]COUNT field incorrect ".I think i set
How to store JComboBox selected Item into Ms Access Database - Java Beginners
How to store JComboBox selected Item into Ms Access Database  How to store JComboBox selected Item into Ms Access Database.  Hi Friend...:access","",""); Statement stmt=con.createStatement(); ResultSet rs
fetch record from oracle database using jsp-servlet?
fetch record from oracle database using jsp-servlet?  how can i fetch data from oracle database by using jsp-servlet. i'm using eclipse, tomcat server and oracle database and creating jsp pages and also using servlet
How To Insert A New Record to MS Access table database in GUI
How To Insert A New Record to MS Access table database in GUI  Hello... that involves inserting a record into a 6-column table in my MS Access database table. I'm..._UPDATABLE); String sql = "select * from DonorTable"; rs
cannot insert data into ms access database - Java Server Faces Questions
cannot insert data into ms access database   go back... Microsoft Access Driver(*.mdb) 5. Select database name and Create the DSN name (e.g emp) 6. Click "Ok" and then try the JSP. form.jsp: Name: Address
Connecting to Database from a hyperlink in JSP - JSP-Servlet
Connecting to Database from a hyperlink in JSP  How can I connect to database by clicking on a hyperlink in a JSP Page.Can you please give me sample... which is connect to database using jdbc database
retriving image from database - JSP-Servlet
retriving image from database  how to retrive image from mysql database by using servlet programming  Hi Friend, Please visit the following link: http://www.roseindia.net/servlets/retreiveimage.shtml Thanks
Advertisements
 

 

 

DMCA.com