-
inserting binary data(images,music) into MS Access using jsp (3 messages)
- Posted by: michael osakede
- Posted on: February 18 2007 05:15 EST
i have been tring to insert an image into ms access but it has not been working for me using the "setBinaryStream()", please can anyone help witha code for inserting binary files into a MS Access DB using JSP?Threaded Messages (3)
- Re: inserting binary data(images,music) into MS Access using jsp by Udayan Patel on February 19 2007 11:28 EST
- Re: inserting binary data(images,music) into MS Access using jsp by Jyothish John on February 22 2007 16:11 EST
- Re: inserting binary data(images,music) into MS Access using jsp by Jyothish John on February 22 2007 04:13 EST
- Re: inserting binary data(images,music) into MS Access using jsp by Jyothish John on February 22 2007 16:11 EST
-
Re: inserting binary data(images,music) into MS Access using jsp[ Go to top ]
- Posted by: Udayan Patel
- Posted on: February 19 2007 11:28 EST
- in response to michael osakede
Which driver are you using? -
Re: inserting binary data(images,music) into MS Access using jsp[ Go to top ]
- Posted by: Jyothish John
- Posted on: February 22 2007 16:11 EST
- in response to Udayan Patel
File file=new File("c:/testpic.jpg"); FileInputStream in=new FileInputStream(file); PreparedStatement ps=connection.prepareStatement("insert into image_table (IMAGE) values(?);"); ps.setBinaryStream(2,in,(int)file.length()); ps.execute(); ps.close(); And make sure the Type is OLE for the field which contains the Image data. -
Re: inserting binary data(images,music) into MS Access using jsp[ Go to top ]
- Posted by: Jyothish John
- Posted on: February 22 2007 16:13 EST
- in response to Jyothish John
one correction , the index 2 should be 1 ps.setBinaryStream(1,in,(int)file.length());