@Test public void testBindValue_empty() throws Exception { Connection conn = new MockConnection(); PreparedStatement ps = conn .prepareStatement("select * from a where b = ?"); BinaryType binaryType = new BinaryType(); binaryType.bindValue(ps, 1, ""); }
public void bindValue(PreparedStatement ps, int index, String value) throws SQLException { if (value == null) { ps.setNull(index, Types.BINARY); } else if (value.length() == 0) { ps.setBytes(index, EMPTY_BYTES); } else { ps.setBytes(index, Base64Util.decode(value)); } }
BinaryType extends AbstractSqlType { public void bindValue(PreparedStatement ps, int index, String value) throws SQLException { if (value == null) { ps.setNull(index, Types.BINARY); } else if (value.length() == 0) { ps.setBytes(index, EMPTY_BYTES); } else { ps.setBytes(index, Base64Util.decode(value)); } } }
BinaryType extends AbstractSqlType { public void bindValue(PreparedStatement ps, int index, String value) throws SQLException { if (value == null) { ps.setNull(index, Types.BINARY); } else if (value.length() == 0) { ps.setBytes(index, EMPTY_BYTES); } else { ps.setBytes(index, Base64Util.decode(value)); } } BinaryType();  BinaryType(String dataType); }
BinaryType extends AbstractSqlType { public void bindValue(PreparedStatement ps, int index, String value) throws SQLException { if (value == null) { ps.setNull(index, Types.BINARY); } else if (value.length() == 0) { ps.setBytes(index, EMPTY_BYTES); } else { ps.setBytes(index, Base64Util.decode(value)); } } BinaryType();  BinaryType(String dataType); void bindValue(PreparedStatement ps, int index, String value); String getValue(ResultSet resultSet, int index); }
BinaryType extends AbstractSqlType { public void bindValue(PreparedStatement ps, int index, String value) throws SQLException { if (value == null) { ps.setNull(index, Types.BINARY); } else if (value.length() == 0) { ps.setBytes(index, EMPTY_BYTES); } else { ps.setBytes(index, Base64Util.decode(value)); } } BinaryType();  BinaryType(String dataType); void bindValue(PreparedStatement ps, int index, String value); String getValue(ResultSet resultSet, int index);  }