This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Data from JForm to databse

 
himanshu rai
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
while doing the following tutotrial

http://netbeans.org/kb/67/java/gui-db-custom.html

i get the following error while trying to save in the Orders tabel

Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'AUTHORISIN_EMPLOYEE_ID' cannot be null
Error Code: 1048
Call: INSERT INTO test7.requisition_transaction (QUANTITY_REQUESTED, AUTHORISIN_EMPLOYEE_ID, REQUISITION_DATE, SERIAL_NUMBER, EMPLOYEE_ID, ITEM_CODE) VALUES (?, ?, ?, ?, ?, ?)
bind => [0, null, null, 0, 12, null]

apparaently te data is not going from the jform to the database..any workaround.


 
Madhan Sundararajan Devaki
Ranch Hand
Posts: 312
Java MS IE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe, you need to send the data to the database, there is no workaround !
 
himanshu rai
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i do everything as per the mentioned tutorial. So i dont know where im going wrong..

on searching i found other users hav ahd the same issue witht his tutorial,any idea what the problem could be!
 
Madhan Sundararajan Devaki
Ranch Hand
Posts: 312
Java MS IE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe, except the employee ID the rest are not being sent to the database, wherein they may have defined some of the columns to be "not null".
 
himanshu rai
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yyeah emplyee ID is a foreign key ..so im not taking an input for that but all the fields in the jdialog form are not wrking
 
Madhan Sundararajan Devaki
Ranch Hand
Posts: 312
Java MS IE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One other possibility is that, there should be a location within the application where you map the JForm fields to Java class/attributes. Please check if you have carried out the mapping, carefully.
 
himanshu rai
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes checked that as well.
this tutorial requires making two seperate forms, one of them is working. this one isn't..i followed the same methods.
 
Madhan Sundararajan Devaki
Ranch Hand
Posts: 312
Java MS IE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which of the two forms is working?
 
himanshu rai
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the one in the master table..its the employee form that is working..

this is the form for the detail table..
 
Madhan Sundararajan Devaki
Ranch Hand
Posts: 312
Java MS IE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see two forms (one for Customer and another for Order). Where is the employee form?
 
himanshu rai
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh sorry..i changed the neames of the tables..the Order form is not working..

The customer form attaches to the master table that is wrking..
the order form attaches to the detail table that is not wrking
 
Madhan Sundararajan Devaki
Ranch Hand
Posts: 312
Java MS IE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please check the entries related to the Order table, for example, names of table, column, etc...
 
himanshu rai
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
checked!! the same issue..

some1 else had the same problem and was resolved.
http://www.coderanch.com/t/446646/JDBC/java/null-value-database-table-JForm

dont know how!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic