为什么setBlob(index,InputStream)会出现ClassCastException

我的数据库用的是MySql
InputStream inputStream = new FileInputStream("E:\EclipseSave\JDBC\src\2.jpg");
preparedStatement.setBlob(4, (Blob) inputStream);//写这句时Eclipse出错提示要将inputStream强转为Blob

http://www.itnose.net/detail/6108277.html

使用blob类型来存储大数据!