On 4 June 2011 10:42, Steven Schlansker <stevenschlansker@gmail.com> wrote:
> + private String determineSQLType(Object[] array) {
> + Class<?> componentType = array.getClass().getComponentType();
> + if (componentType.equals(byte.class) || componentType.equals(Byte.class))
> + return "tinyint";
Note that the test vs. byte, int, etc will never fire, because arrays
of primitive types are not instanceof Object[]
Can we do anything better when given, say, an Object[] (not Integer[])
that contains only Integer instances?
Not sure if you can do anything sensible here, since an Object[] could
also contain a heterogeneous mix of types.
There seems to be some duplication between determineSQLType() and the
switch in setObject().
Oliver