我正在使用到Oracle数据库的JDBC连接。以下是我的查询
structure(list(Name = structure(c(1L, 2L, 3L, 4L, 1L, 2L, 3L), .Label = c("A",
"B ", "C", "D"), class = "factor"), Date = structure(c(1L, 1L,
1L, 2L, 2L, 2L, 2L), .Label = c("1/1/2018", "1/4/2018"), class = "factor"),
Val1 = 1:7, Val2 = 2:8), class = "data.frame", row.names = c(NA,
-7L))
现在我使用准备好的语句来设置参数-
SELECT A.SOME FROM SCH.TABLE_1 A
INNER JOIN SCH.TABLE_2
ON A.OTHER = B.OTHER
WHERE B.COND = ?
val是一个String对象,但是可以为null。那么当它为null时会发生什么呢?
最终查询是否具有
pStmt.setString(1, val);
或
B.COND = 'NULL'
我相信='NULL'将是字符串文字,并且= NULL与IS NULL类似,即未定义。