Hi,
I got my query working with SQL Server and a different driver . The
.bmp file is getting is created but It is not rendered as an image i.e I
am not able to open it with Paint Brush or any other Image editors . I have
tried placing a text file (saved as a .doc) in the column field(OLE
Object).With this I am able to write the text to the file .But formatting is
lost.
Can any one tell me how to get an image from a Data Base and write to a file
with the same extension (I should be able to view the image)
Thanx in advance.
Regards,
Raja
William Crawford wrote:
> It's not supported using the JDBC-ODBC bridge, apparently. They didn't
> implement that particular method. You should be able to get it working
> using a real database <grin>.
>
> At 12:50 PM 6/23/2000 +0530, you wrote:
> >Hi all,
> > I am trying to get a column name from an MS-Access table.The
> >column is of type OLE Object.An Image is stored in it. I have written
> >the following code.
> >
> >
> >Code starts
> >
> > ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM
> >Employees");
> > int i = 0;
> > while (rs.next())
> > {
> > BufferedInputStream in = new
> >BufferedInputStream(rs.getBinaryStream(15));
> > byte[] buff = new byte[2*8192];
> > FileOutputStream out = new
> >FileOutputStream("c:\\csb-ets\\test"+i+".bmp");
> > int b;
> >
> >
> > try
> > {
> > while ((b = in.read(buff, 0, buff.length)) != -1)
> > {
> > System.out.println("In while"); System.out.println("In
> >while");
> > System.out.println(b);
> > out.write(b);
> > }
> > }
> > catch(IOException ioe)
> > {
> > ioe.printStackTrace();
> > }
> > out.flush();
> > i++;
> > }
> >
> >Code Ends
> >
> >
> >The .bmp file is getting created . But it is of zero size.Also iam
> >getting the run time exception
> >"Buffered Inout Stream.read() Not implemented. I am using jdk1.2 and
> >the method is there.
> >
> >Can some one shed some light on this.
> >
> >
> >Thanx in advance,
> >
> >Regards,
> >S.S.Rajagopal
> >
> >___________________________________________________________________________
> >To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> >of the message "signoff SERVLET-INTEREST".
> >
> >Archives: http://archives.java.sun.com/archives/servlet-interest.html
> >Resources: http://java.sun.com/products/servlet/external-resources.html
> >LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
> ---
> William Crawford + 01 617 577 7844
> Invantage, Inc [EMAIL PROTECTED]
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html