I have a SQL database in a Gridgain cache and one column of that database is a short array.
Column name | Data type |
---|---|
Order Id | Integer |
Timestamp | Long |
Activity | Short [] |
My SQL query is like this.
String sql = "Select activity from cache where orderId = ? and timestamp <= ? and timestamp >= ? ";
I am executing following java code. Since I am not sure about the return data type I assigned the return value to an object and printed its type. result was
XX [S@3eb7630d XX type class [S
Code is
Object xx = null;
List<Short> activityList = new ArrayList<>();
try (QueryCursor<List<?>> cursor = patientTriggerCache.query(sql)) {
for (List<?> row : cursor) {
xx = row.get(0);
activityList.add((short) xx);
}
}
error is
java.lang.ClassCastException: [S cannot be cast to java.lang.Short