我正在尝试将一个int列表传递到我准备好的语句中:
Connection conn = this.getConnection();
String queryPrincipal = SELECT_DESTINOS;
Object [] iniciaValores = new Object[lista.size()];
int i = 0;
for (TabelaNegociacaoDTO tabelaNegociacaoDTO : lista) {
iniciaValores[i] = Integer.parseInt(tabelaNegociacaoDTO.getId().toString());
i++;
}
Array sqlArray = conn.createArrayOf("INTEGER", iniciaValores);
//Set array into prepared statement here
但是当我尝试执行createArrayOf时,它给了我一个SQL异常。有什么我做错了吗?