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 219815

Summary: Database explorer tool, can not view data as "long varchar" with Sybase ASA v10 and v12 drivers.
Product: db Reporter: rickqin <rickqin>
Component: CodeAssignee: Jaroslav Havlin <jhavlin>
Status: RESOLVED FIXED    
Severity: normal Keywords: NETFIX
Priority: P2    
Version: 7.2   
Hardware: PC   
OS: Windows 7 x64   
Issue Type: DEFECT Exception Reporter:
Attachments: IDE log
proposed patch v1

Description rickqin 2012-10-10 12:18:41 UTC
Product Version = NetBeans IDE 7.2 (Build 201207171143)
Operating System = Windows 7 version 6.1 running on x86
Java; VM; Vendor = 1.6.0_33
Runtime = Java HotSpot(TM) Client VM 20.8-b03

Database explorer tool
Sybase ASA, jconn3.jar, com.sybase.jdbc3.jdbc.SybDataSource & com.sybase.jdbc3.jdbc.SybDrive.
Can not view data in the table which contains column of long varchar type.

java.lang.UnsupportedOperationException: The method com.sybase.jdbc3.jdbc.SybResultSet.getClob(int) is not supported and should not be called.
	at com.sybase.jdbc3.jdbc.ErrorMessage.raiseRuntimeException(Unknown Source)
	at com.sybase.jdbc3.utils.Debug.notSupported(Unknown Source)
	at com.sybase.jdbc3.jdbc.SybResultSet.getClob(Unknown Source)
	at org.netbeans.modules.db.dataview.util.DBReadWriteHelper.readResultSet(DBReadWriteHelper.java:267)
	at org.netbeans.modules.db.dataview.output.SQLExecutionHelper.loadDataFrom(SQLExecutionHelper.java:518)
	at org.netbeans.modules.db.dataview.output.SQLExecutionHelper.initialDataLoad(SQLExecutionHelper.java:141)
	at org.netbeans.modules.db.dataview.output.DataView.create(DataView.java:105)
	at org.netbeans.modules.db.dataview.api.DataView.create(DataView.java:74)
[catch] at org.netbeans.modules.db.sql.execute.SQLExecuteHelper.execute(SQLExecuteHelper.java:116)
	at org.netbeans.modules.db.sql.loader.SQLEditorSupport$SQLExecutor.run(SQLEditorSupport.java:564)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1452)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2032)
Comment 1 rickqin 2012-10-10 12:18:52 UTC
Created attachment 125683 [details]
IDE log
Comment 2 rickqin 2012-10-10 12:21:44 UTC
nb7.0.2 is ok.
Comment 3 matthias42 2012-10-11 17:52:00 UTC
Created attachment 125797 [details]
proposed patch v1

(In reply to comment #0)
> Database explorer tool
> Sybase ASA, jconn3.jar, com.sybase.jdbc3.jdbc.SybDataSource &
> com.sybase.jdbc3.jdbc.SybDrive.
> Can not view data in the table which contains column of long varchar type.
> 
> java.lang.UnsupportedOperationException: The method
> com.sybase.jdbc3.jdbc.SybResultSet.getClob(int) is not supported and should not
> be called.
>     at com.sybase.jdbc3.jdbc.ErrorMessage.raiseRuntimeException(Unknown Source)
>     at com.sybase.jdbc3.utils.Debug.notSupported(Unknown Source)
>     at com.sybase.jdbc3.jdbc.SybResultSet.getClob(Unknown Source)
>     at
> org.netbeans.modules.db.dataview.util.DBReadWriteHelper.readResultSet(DBReadWriteHelper.java:267)

Jay! It would have be too easy to wrap the Error into an SQLException, which is already caught (and documented to be thrown by getClob...). Someday I will meet a jdbc driver developer ... :-)

Can you try the attached patch? It was created against netbeans core-main and catches the exception - whether this fixes all issues remains to be seen.
Comment 4 Jaroslav Havlin 2012-10-22 15:58:29 UTC
The patch seems OK.
Integrated as http://hg.netbeans.org/core-main/rev/209beea7c2e9
Thank you very much, Matthias.

Rickqin, please verify.
Comment 5 Quality Engineering 2012-10-25 10:52:36 UTC
Integrated into 'main-golden', will be available in build *201210250921* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/209beea7c2e9
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #219815: Database explorer tool, can not view data as "long varchar" with Sybase ASA v10 and v12 drivers