Menu

Saving of Boolean types

Help
2014-07-02
2014-07-02
  • omen666blue

    omen666blue - 2014-07-02

    hi sorry its me again!
    so iv been racking my brain as to why i am having issues and im presuming its something simple!
    Basically i have a simple form with 1 textbox, and 1 checkbox.
    i then have a ClientName Table in my database with ClientName and Meeting Client name is ShortText and Meeting is Yes/No.

    i then try to feed this back to my Database using code similar below

    "UPDATE ClientTable SET ClientName='"+clientName+"'and Meeting="+meeting+"";

    Now when i input the data into my Form and click the save button i get an acception saying:
    SQL STATEMENT IS : UPDATE ClientTable SET ClientName='Test'and Meeting=true
    Errornet.ucanaccess.jdbc.UcanaccessSQLException: data type of expression is not boolean

    Now im sure it is something really simple and stupid but im litterally just starting out with Java and SQL so im a little rusty i have tried searching for subject matter and to find any examples on processing Booleans but am so far coming up with very little!

    any help in this matter would be very much appreciated!

     
  • Marco Amadei

    Marco Amadei - 2014-07-02

    Hi,
    your sql is wrong. Try the following:
    UPDATE ClientTable SET ClientName='Test', Meeting=true
    Another useful information: notice that it's better to use the 2.0.7 which has a bug fix related to boolean type management.
    Cheers Marco

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.