It's giving error
"Exception in thread "main" java.lang.AbstractMethodError:
Method com/mysql/jdbc/ServerPreparedStatement.setBinaryStream(ILjava/io/InputStream;)V is abstract
at com.mysql.jdbc.ServerPreparedStatement.setBinaryStream(ServerPreparedStatement.java)
at jdbc.demo.main(demo.java:21)".
I have added my code snippet as follow, can you please give me an insight what am I doing wrong?
import java.io.File;
import java.io.FileInputStream;
import java.sql.*;
public class demo{
public static void main(String args[]) throws Exception{
String url = "jdbc:mysql://localhost:3306/tutorial1";
String name = "root";
String pass = "rubyonrails$";
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection(url,name,pass);
String sql = "update binarylargeobject set resume=? where id=1";
PreparedStatement st = con.prepareStatement(sql);
File file = new File("C:\\Users\\USER\\Desktop\\vid.pdf");
FileInputStream input = new FileInputStream(file);
st.setBinaryStream(1,input);
st.executeUpdate();
}
}