I have a variable in java whose return type is Object (java.lang.Object). I want to store this value of a variable in a MySQL database without using any other primitive data types. Is there any data type available in MySQL related to Object?
You can use it BLOBto store raw data, but otherwise, MySQL does not have a specific data type for a java object.
BLOB
As a side note. You probably should not store the raw object in the database, which prevents you from making any queries on it.
, XML JSON. , . Xstream, . , /.
, , Bean/POJO.
BLOB could do this. Serialize the object into an array of bytes, and INSERT as a BLOB.