• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Data from JForm to databse

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.


 
Ranch Hand
Posts: 312
MS IE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
MS IE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
MS IE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
MS IE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which of the two forms is working?
 
himanshu rai
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
MS IE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
MS IE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
checked!! the same issue..

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

dont know how!
 
Bring me the box labeled "thinking cap" ... and then read this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic