aspose file tools*
The moose likes JDBC and the fly likes Data from JForm to databse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Data from JForm to databse" Watch "Data from JForm to databse" New topic
Author

Data from JForm to databse

himanshu rai
Greenhorn

Joined: Jun 22, 2011
Posts: 12
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

Joined: Mar 18, 2011
Posts: 312

I believe, you need to send the data to the database, there is no workaround !


S.D. MADHAN
Not many get the right opportunity !
himanshu rai
Greenhorn

Joined: Jun 22, 2011
Posts: 12
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

Joined: Mar 18, 2011
Posts: 312

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

Joined: Jun 22, 2011
Posts: 12
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

Joined: Mar 18, 2011
Posts: 312

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

Joined: Jun 22, 2011
Posts: 12
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

Joined: Mar 18, 2011
Posts: 312

Which of the two forms is working?
himanshu rai
Greenhorn

Joined: Jun 22, 2011
Posts: 12
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

Joined: Mar 18, 2011
Posts: 312

I see two forms (one for Customer and another for Order). Where is the employee form?
himanshu rai
Greenhorn

Joined: Jun 22, 2011
Posts: 12
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

Joined: Mar 18, 2011
Posts: 312

Please check the entries related to the Order table, for example, names of table, column, etc...
himanshu rai
Greenhorn

Joined: Jun 22, 2011
Posts: 12
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
 
subject: Data from JForm to databse