Answer the question
In order to leave comments, you need to log in
Sql.Array in mssql jdbc4 java.sql.SQLFeatureNotSupportedException: This operation is not supported Bug?
It is necessary to make a selection on the MSSQL database of the form select pathstr from edo_file where id in (?)
where ? this is an array of IDs of the required entries.
In software, one of the classes returns me a regular array of type Long[], for example
idArray = new Long[] {1003215L,100358L,100456L};
Long[] idArray = new Long[] {1003215L,100358L,100456L};
String sql = "select pathstr from edo_file where id in (?)";
java.sql.Array idArraySql = con.createArrayOf("NUMERIC",idArray);
PreparedStatement ps = con.prepareStatement(sql);
ps.setArray(1,idArraySql);
ResultSet rs = ps.executeQuery();
public Array createArrayOf(String var1, Object[] var2) throws SQLException {
DriverJDBCVersion.checkSupportsJDBC4();
throw new SQLFeatureNotSupportedException(SQLServerException.getErrString("R_notSupported"));
}
StringBuilder sb = new StringBuilder();
for(int i=0;i<idArray.length;i++){
sb.append("'");
sb.append(idArray[i]);
sb.append("'");
if (i<idArray.length-1){
sb.append(",");
}
}
sql=sql.replace("?",sb.toString());
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question