1

I'm trying to set a BLOB in MySQL DB as below:

PreparedStatement ps=con.prepareStatement("insert into image values(?,?,?,?,?)");

ps.setString(1,firstname);
ps.setString(2,lastname);
ps.setString(3,address);
ps.setString(4,phone);

if(is!=null)  
{
    ps.setBlob(5,is);
}   

int i=ps.executeUpdate();

The line ps.setBlob(5,is) throws the below exception:

java.lang.AbstractMethodError: com.mysql.jdbc.PreparedStatement.setBlob(ILjava/io/InputStream;)V

How it this caused and how can I solve it?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Aso
  • 11
  • 1
  • 1
    @Shriram He linked to the error in the first line. http://i.stack.imgur.com/nMz2E.png – Calvin P. Nov 08 '15 at 17:14
  • May be this link helps http://stackoverflow.com/questions/1194990/why-do-i-get-java-lang-abstractmethoderror-when-trying-to-load-a-blob-in-the-db – Shriram Nov 08 '15 at 17:18
  • The error message text should be in the question itself, not contained in an image that's linked externally. – Kelly Keller-Heikkila Nov 08 '15 at 18:05
  • 1
    That's fine, but the error message should not be in an image. The text should be copy/pasted into the question. Otherwise the question and answer can't be found by others who may get the same error in the future. – Kelly Keller-Heikkila Nov 08 '15 at 18:26

0 Answers0