Menu

how are lengths of fields handled

peddu
2006-01-11
2013-04-25
  • peddu

    peddu - 2006-01-11

    Any idea on how the lengths of fields are handled when creating or updating a row.

    For example consider my table has a column
    USERNAME CHAR(8)

    The bean object created has the set method say
    setUSERNAME(String newval) which doesnot validate the length. So if code accessing this method updates the field to a 10 or 20 character string, how is it handled.
    is it truncated while being updated to the row
    is an exception thrown by the driver
    is it handled somewhere in the code that i havenot seen.

    if it is the first two cases, it would be good to include length handling in the beans set method.. like throwing a size/length exceeded exception..
    more later
    peddu

     

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.