This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 254904

Summary: org.netbeans.modules.db.dataview.meta.DBException: Please enter valid values for not nullable columns
Product: db Reporter: skygo <skygo>
Component: Show DataAssignee: matthias42
Status: VERIFIED FIXED    
Severity: normal CC: skomisa
Priority: P3    
Version: 8.1   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 219591
Attachments: stacktrace

Description skygo 2015-09-01 12:03:36 UTC
Build: NetBeans IDE Dev (Build 201508310002)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.60-b23, Java(TM) SE Runtime Environment, 1.8.0_60-b27
OS: Windows 10

User Comments:
skygo: Adding data to database with null not populated




Stacktrace: 
org.netbeans.modules.db.dataview.meta.DBException: Please enter valid values for not nullable columns
   at org.netbeans.modules.db.dataview.output.SQLStatementGenerator.generateInsertStatement(SQLStatementGenerator.java:96)
   at org.netbeans.modules.db.dataview.output.InsertRecordDialog$9.doInBackground(InsertRecordDialog.java:388)
   at org.netbeans.modules.db.dataview.output.InsertRecordDialog$9.doInBackground(InsertRecordDialog.java:379)
   at javax.swing.SwingWorker$1.call(SwingWorker.java:295)
   at java.util.concurrent.FutureTask.run(FutureTask.java:266)
   at javax.swing.SwingWorker.run(SwingWorker.java:334)
Comment 1 skygo 2015-09-01 12:03:39 UTC
Created attachment 155798 [details]
stacktrace
Comment 2 skygo 2015-09-01 12:10:02 UTC
Lots of error in sql like foreing keys violation or wrong type / limit are handled by a popup showing what is wrong.

The exception seems to occurs only for not null field you set at null.
Comment 3 matthias42 2015-09-01 16:02:40 UTC
Thank you for finding this. Indeed the "normal" way is, that an exception generated when inserting rows is reported with the NotificationDisplayer, in this case the exception was rethrown as a RuntimeException which was then reported by netbeans. The change committed as:

http://hg.netbeans.org/core-main/rev/402f8d254d76

Fixes this by catching the exception and displaying it correctly.

In the next few hours/days a nightly build containing this fix will be available. Please test it and if you find the problem fixed, please report it here and change the status of the bug to VERIFIED.
Comment 4 Quality Engineering 2015-09-02 05:15:43 UTC
Integrated into 'main-silver', will be available in build *201509020320* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/402f8d254d76
User: Matthias Blaesing <matthias42@netbeans.org>
Log: #254904: Report problems inserting rows in the same way
Comment 5 skygo 2015-09-02 16:19:06 UTC
Hi, thanks for the fix.
Comment 6 matthias42 2015-09-29 19:04:22 UTC
*** Bug 255594 has been marked as a duplicate of this bug. ***