tinyint(1) showing as bit?

If Java is showing you tinyint(1) as a boolean bitfield, that’s probably because MySQL recently changed the behavior of tinyint:

As of MySQL 5.0.3, a BIT data type is available for storing bit-field values. (Before 5.0.3, MySQL interprets BIT as TINYINT(1).) In MySQL 5.0.3, BIT is supported only for MyISAM. MySQL 5.0.5 extends BIT support to MEMORY, InnoDB, BDB, and NDBCLUSTER.

To convince your JDBC driver to show you tinyint for the tiny little int that it actually is, rather than as a boolean, try setting the tinyInt1isBit=false parameter when connecting.

Leave a Reply

Your email address will not be published. Required fields are marked *