I have a function in my project that deals with row results from query, and switches between the column types. The problem with doing this with Cassandra, is that I can't switch between the types, because this line won't work:
type = rs.getColumnType(i);
Here is the full snippet code:
ResultSet rs = session.execute(query);
for (int i = 0; i < rs.getColumnDefinitions().size(); i++) {
type = rs.getColumnType(i);
switch (type) {
case Types.SMALLINT:
break;
case Types.INTEGER:
break;
case Types.BIGINT:
break;
case Types.DECIMAL:
break;
case Types.NUMERIC:
break;
case Types.FLOAT:
break;
case Types.DOUBLE:
break;
default:
}
}
I'm trying to figure out how to switch between column types