Two Laptop Bag*
The moose likes JDBC and the fly likes null value to database table from JForm Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "null value to database table from JForm" Watch "null value to database table from JForm" New topic
Author

null value to database table from JForm

Gokcen Guner
Greenhorn

Joined: May 23, 2009
Posts: 9
Im working on a project similar to custom database app tutorial of NetBeans (http://www.netbeans.org/kb/docs/java/gui-db-custom.html)

When I try to add new record to detail table i get he error:



There are a lot of errors too, but that may be enough. If not i can post it too.
I've just followed the instructions in the tutorial to trace the problem and they are all the same. I couldn't find the problem.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19651
    
  18

Gokcen Guner wrote:Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'offense' cannot be null

Apparently, in your database table, you've specified that column "offense" cannot have any null values.

Moving to JDBC.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Gokcen Guner
Greenhorn

Joined: May 23, 2009
Posts: 9
thanks for reply. Eventually Ive found why the data didnt go to database from JForm.
himanshu rai
Greenhorn

Joined: Jun 22, 2011
Posts: 12
@Gokcen Guner
Im having the same problem, how did solve it?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: null value to database table from JForm
 
Similar Threads
Error in Many to Many persisting EJB3 Toplink
Problem In EJB COde (Using Netbeans Code)
Netbeans 6.5: Populating JTable with MySQL database
Adding many-to-many relationships using TopLink
JPA - How to reconnect EntityManager