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.
This bug was originally marked as duplicate of bug 206233, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related. Build: NetBeans IDE 7.1.2 (Build 201204101705) VM: Java HotSpot(TM) Client VM, 1.6.0-b105, Java(TM) SE Runtime Environment, 1.6.0-b105 OS: Windows Vista User Comments: cloeffler: not all data in table is displayed schkovich: Executing SQL statement returning empty result set most likely GUEST: even using thin driver not able to view image data schkovich: error in sql query Stacktrace: java.lang.NullPointerException at org.netbeans.modules.db.dataview.util.DBReadWriteHelper.readResultSet(DBReadWriteHelper.java:211) at org.netbeans.modules.db.dataview.output.SQLExecutionHelper.loadDataFrom(SQLExecutionHelper.java:515) at org.netbeans.modules.db.dataview.output.SQLExecutionHelper.initialDataLoad(SQLExecutionHelper.java:134) at org.netbeans.modules.db.dataview.output.DataView.create(DataView.java:105) at org.netbeans.modules.db.dataview.api.DataView.create(DataView.java:74) at org.netbeans.modules.db.sql.execute.SQLExecuteHelper.execute(SQLExecuteHelper.java:119)
Created attachment 121808 [details] stacktrace
Ah - you would think implementing the jdbc specification is not that complex. From the stacktrace the problem arises from: byte[] bdata = rs.getBytes(index); the stacktrace indicates, that bdata is null after this call. After this call the further process is guarded by a call to rs.wasNull() - which had to return false to reach the reported line. This case is partly fixed in the upcoming 7.2 version, in which the whole blob/varbinary handling was reworked. The only missing part is a guard for the Types.BIT case. For the committers: Please add a guard in DBReadWriteHelper.java in line 192. There the call to rs.wasNull() is done, I would add a guard for a null result: if (rs.wasNull() || bdata == null) {
(In reply to comment #2) > For the committers: > > Please add a guard in DBReadWriteHelper.java in line 192. There the call to > rs.wasNull() is done, I would add a guard for a null result: > > if (rs.wasNull() || bdata == null) { Fixed in http://hg.netbeans.org/core-main/rev/271f799ec3db Thank you, Matthias.
Integrated into 'main-golden', will be available in build *201207110002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/271f799ec3db User: Jaroslav Havlin <jhavlin@netbeans.org> Log: #215255: NPE at DBReadWriteHelper.readResultSet