Two Laptop Bag*
The moose likes JDBC and the fly likes Rpt : Image Inesertion some1 check this code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Rpt : Image Inesertion some1 check this code" Watch "Rpt : Image Inesertion some1 check this code" New topic

Rpt : Image Inesertion some1 check this code

akilan kandaswamy

Joined: Feb 26, 2001
Posts: 4
hai ,
I tried to retrieve an image from MSACCESS using the following code im getting an Exception IOException:MEthod not implemented some1 pls help me, how to enter an imae into an DataBase?

import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class GetImage4 extends HttpServlet
Connection con;
Statement st;
ResultSet rs;
public void doGet(HttpServletRequest req,HttpServletResponse res)throws ServletException,IOException
PrintWriter out=res.getWriter();
con=DriverManager.getConnection("jdbc dbc:sasi");
rs=st.executeQuery("SELECT * FROM IMAGE");;

BufferedInputStream bis=new BufferedInputStream(rs.getBinaryStream(2));
byte[] bb=new byte[4 * 1024];
int dd=rs.getInt(1);

int len=0;
catch(Exception e)
{ System.out.println(e);e.printStackTrace(); }
David Freels
Ranch Hand

Joined: Feb 01, 2001
Posts: 102
Use PreparedStatement instead of Statement when retrieving data from BLOBs or CLOBs.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Rpt : Image Inesertion some1 check this code
Similar Threads
Problem with servlet reading images in database!
displaying image from database
Could Anyone correct my Error with JDBC
Retreving PDF File from Database using Java
How to give Servlet response from Tag Handler class?