Skip to content

Commit 83c2ded

Browse files
committed
fixup! simple fix of oracle stream API for RAW column
Oracle will return "[B" as class name for byte[], I don't know why the class loader is not able to load this. So when we try to call getObject for this column, it is called with null class argument. So let's return the correct class in this case. Signed-off-by: turakamou <[email protected]>
1 parent 8036db5 commit 83c2ded

File tree

1 file changed

+4
-1
lines changed
  • vertx-oracle-client/src/main/java/io/vertx/oracleclient/impl

1 file changed

+4
-1
lines changed

vertx-oracle-client/src/main/java/io/vertx/oracleclient/impl/RowReader.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
public class RowReader<C, R> implements Flow.Subscriber<Row>, Function<oracle.jdbc.OracleRow, Row> {
3939

4040
private static final Logger LOG = LoggerFactory.getLogger(RowReader.class);
41+
private static final String byteArrayClassName = byte[].class.getName();
4142

4243
private final ContextInternal context;
4344
private final List<String> types;
@@ -187,7 +188,9 @@ private static Row transform(List<String> ors, RowDesc desc, oracle.jdbc.OracleR
187188

188189
private static Class<?> getType(String cn) {
189190
try {
190-
if (cn.equals(byte[].class.getName())) {
191+
// Oracle will return "[B" as class name for byte[], I don't know why the class loader is not able to load this
192+
// So let's return the correct class in this case
193+
if (cn.equals(byteArrayClassName)) {
191194
return byte[].class;
192195
}
193196
return OraclePreparedQueryCommand.class.getClassLoader().loadClass(cn);

0 commit comments

Comments
 (0)