Home arrow static arrow Java Programming [Archive] - database type ANY
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - database type ANY
This topic has 1 reply on 1 page.

Posts:52
Registered: 7/6/04
database type ANY  
Jul 17, 2004 4:09 PM



 
i am building a small database, in which any input in a table must be of type of that column, there may be int, boolean, or any user-defined type. however, i need a type ANY that can take any types. i defined the types by calling appropriate java class such as String.class, Integer.class or any user-defined class.

when we take an input (Object v), i check if its type is of the type of that column (class c) by calling:
c.isAssignalbeFrom(v.getClass());

however, i dont know how i should define ANY (what type i should give to ANY), i tried Object.class, but it wont work (because primary types are not object?), can anyone help? thanks!
 

Posts:2,522
Registered: 3/6/01
Re: database type ANY  
Jul 17, 2004 8:43 PM (reply 1 of 1)



 
There is no type in Java that represents any type. The closest you can come is Object, and use Integer, Long, etc for your primitive types.
 
This topic has 1 reply on 1 page.