This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 19541
    
  16

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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: null value to database table from JForm
 
Similar Threads
Error in Many to Many persisting EJB3 Toplink
Netbeans 6.5: Populating JTable with MySQL database
Problem In EJB COde (Using Netbeans Code)
Adding many-to-many relationships using TopLink
JPA - How to reconnect EntityManager