Translate

martes, 4 de julio de 2017

MySql tinyInt1isBit = false

Hoy una entrada rápida que puede salvar más de un problema una vez que tenemos nuestra base de datos ya definida o simplemente la hemos heredado de otra persona o proveedor.

Que ocurre si tenemos definido un campo en una tabla MySQL como tinyint, este es un campo que se usa para almacenar datos de 8bits es decir valores de 0 a 255.

Pero normalmente se utiliza para valor es boolean tipo true false. En mi caso hoy hemos tenido un problema porque tenemos una columna definida con este tipo de datos y en la tabla tenemos valores 0, 1, 2, etc.... El problema ha surgido porque el driver de mysql php ha traducido el valor correctamente pero el de java no lo ha hecho.

El driver de php traduce correctamente el valor 2, pero en Java nos devuelve el valor true. 

Curioseando por la web hemos visto que si en los parámetros de conexión de MySQL añadimos la siguiente cadena de conexión en la conexión java tinyInt1isBit=false el valor será interpretado correctamente como un 2.

Esto a más de uno le puede salvar de más de un problema.


14 comentarios:

  1. Este comentario ha sido eliminado por un administrador del blog.

    ResponderEliminar
  2. This blog is having the general information.Got a creative work and this is very different one.We have to develop our creativity mind.This blog helps for this. Thank you for this blog.This is very interesting and useful.

    Selenium Training in Chennai

    ResponderEliminar
  3. ts an awesome article. written in very creative way and it also conveys useful information.

    PYTHON Training in Chennai

    ResponderEliminar
  4. You made some decent factors there. I looked on the internet for the difficulty and found most individuals will associate with along with your website.
    Research Paper Publication
    Science Journal
    IEEE Projects
    Journal Impact Factor
    Highest Impact Factor Journal

    ResponderEliminar
  5. Become a Data Scientist
    Accelerate your career in data science by starting from basics in Statistics, Data Management and Analytics to advanced topics like Neural Networks, Machine Learning and Big Data
    Earn a Scholarship of up to Rs 50,000 on enrolling. Limited seats

    DATA SCIENCE AND MACHINE LEARNING course

    ResponderEliminar
  6. What an extremely wonderful post this is. Genuinely, perhaps the best post I've at any point seen to find in as long as I can remember. Goodness, simply keep it up.
    360DigiTMG data science certification malaysia

    ResponderEliminar
  7. This is a great post I saw thanks to sharing. I really want to hope that you will continue to share great posts in the future.
    artificial intelligence course in noida

    ResponderEliminar
  8. I think I have never watched such online diaries ever that has absolute things with all nuances which I need. So thoughtfully update this ever for us.
    what is hrdf

    ResponderEliminar
  9. On the off chance that your searching for Online Illinois tag sticker restorations, at that point you have to need to go to the privileged place.
    360DigiTMG big data course in malaysia

    ResponderEliminar

  10. It is very ideal to see the best subtleties introduced in a simple and getting way. hrdf scheme

    ResponderEliminar
  11. If you don"t mind proceed with this extraordinary work and I anticipate a greater amount of your magnificent blog entries
    best digital marketing institute in hyderabad

    ResponderEliminar
  12. This post is easy to peruse and acknowledge without forgetting about any subtleties. Extraordinary work!
    https://360digitmg.com/what-is-the-difference-between-analysis-and-analytics

    ResponderEliminar
  13. https://www.blogger.com/comment.g?blogID=6768209&postID=5653569805104587810&page=1&token=1603794073614&isPopup=true

    ResponderEliminar
  14. This is a wonderful article, Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more ... good luck.
    data science training

    ResponderEliminar