What is the best implementation of Boolean in MySQL using java to connect to the database?
I currently have a MySQL database setup, java client access and use database I need to use Boolean data types in the database to determine whether each user of the database allows certain operations Since there are no Boolean data types, what is the best implementation of Boolean values you can use in MySQL?
I know tinyint can be used with Preparedstatement with setbyte (int parameterindex, byte x). I also know that bit can also be used with setboolean (int parameterindex, Boolean x) Which is the better solution for Boolean values? If there were a better solution, what would it be?
Solution
Boolean values in MySQL are synonymous with tinyint (1); If the number of bits is small enough, so is the number of bits From the perspective of MySQL operation, it makes little difference if you use it What do you mean "better"?