is there any other way to do it from java ?
Dee, August 31, 2004 - 11:03 am UTC
is there a way to do it using java.sql.Types.NULL instead ?
I tried to use
cStmt.setNull(3, java.sql.Types.NULL); and also
cStmt.setObject(3, null, java.sql.Types.NULL);
but both throw an "Invalid Column type SQLException"
it seems oracle needs to know the type so it can deal with
the null(unknown). pls. advise if there is an alternative
Thanks
August 31, 2004 - 1:21 pm UTC
just use varchar i guess?
or the real type, why cannot you do that? use the *real* type?
in case of java null, i do not know the real type
Dee, August 31, 2004 - 2:57 pm UTC
i m working on a middle layer - its a wrapper around jdbc
it determines the sql type from the real java type passed to it and uses prepStmt.setObject() always..
Actually, varchar would work but temporarily...because as of now that is the only object(String) type that can be null but i am afraid, it may not cover all cases..
As of now, i force the user of the wrapper to pass the 'Class' and i use that to determine the mapping
however, i wonder if there is a better solution
Thanks
August 31, 2004 - 3:09 pm UTC
oh good, more generic code on top of generic code on top of generic code :)
just wondering -- how would this wrapper class be
a) better
b) easier
c) anything
than just
preparestmt
bind
bind
bind
execute
?