I am trying to store an image into db along with a string.i used the code given below
File image = new File("c:/a1.jpg");
String d=jTextField1.getText();
FileInputStream fis
try {
psmnt = con.prepareStatement("insert into c(name,pic) "+ "values(?,?)");
psmnt.setString(1,d);
fis = new FileInputStream(image);
psmnt.setBinaryStream(2,fis,(int) (image.length()));
psmnt.executeUpdate();
}
catch().....
I tried a lot.But still am getting error " unimplemented or unreasonable conversion requested" .Can anyone help to solve this?pic is declared as blob datatype.Thank you.