mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
解决oracle情况下setObject(inputStream)报错问题,java.sql.SQLException: 无效的列类型问题
This commit is contained in:
@@ -696,6 +696,18 @@ public class StatementWrapper extends SimpleWrapper<PreparedStatement> implement
|
|||||||
// 忽略其它数字类型,按照默认类型传入
|
// 忽略其它数字类型,按照默认类型传入
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Oracle中stream和Blob不能直接通过setObject转换,单独处理
|
||||||
|
//InputStream,解决oracle情况下setObject(inputStream)报错问题,java.sql.SQLException: 无效的列类型
|
||||||
|
if(param instanceof InputStream){
|
||||||
|
this.raw.setBinaryStream(paramIndex, (InputStream) param);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//java.sql.Blob
|
||||||
|
if(param instanceof Blob){
|
||||||
|
this.raw.setBlob(paramIndex, (Blob) param);
|
||||||
|
}
|
||||||
|
|
||||||
// 其它参数类型
|
// 其它参数类型
|
||||||
this.raw.setObject(paramIndex, param);
|
this.raw.setObject(paramIndex, param);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user