Binding a null variable in a PreparedStatement
- by Paul Tomblin
I swear this used to work, but it's not in this case. I'm trying to match col1, col2 and col3, even if one or more of them is null. I know that in some languages I've had to resort to circumlocutions like ((? is null AND col1 is null) OR col1 = ?). Is that required here?
PreparedStatement selStmt = getConn().prepareStatement(
…