If you're lazy about reading the documentation, you can also play ResultSet#getObject()around a bit to find out what type the default JDBC driver returns, and then use it.
System.out.println(resultSet.getObject("columnname").getClass());
source
share