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 75700 - If ResultSetMetaData.isWritable() is no supported, I can't view result
Summary: If ResultSetMetaData.isWritable() is no supported, I can't view result
Status: RESOLVED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: SQL Editor (show other bugs)
Version: 5.x
Hardware: All Windows XP
: P3 blocker (vote)
Assignee: Andrei Badea
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-28 14:48 UTC by clover
Modified: 2006-05-23 13:00 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description clover 2006-04-28 14:48:58 UTC
ResultSetTableModelSupport.createColumnDefs(...) calls 
ResultSetMetaData.isWritable(...). But if this property isn't supported,(eg. 
demo version of Teradata DB), driver throws exception and result can not be 
viewed. 

This fix worked for me:

public static List/*<ColumnDef>*/ createColumnDefs(ResultSetMetaData rsmd) 
throws SQLException {
...
            boolean writable = false;
            try{
                writable = rsmd.isWritable(i) && ctd.isWritable();
            } catch (Exception e){
            }
            
            ColumnDef column = new ColumnDef(
                    rsmd.getColumnName(i), 
                    writable,
                    ctd.getColumnClass());
Comment 1 Andrei Badea 2006-05-16 14:55:02 UTC
Thank you for the code. I will commit it (see below), although unwillingly,
since it is not a fix, but a workaround for something which looks like a bug in
the driver. Please put pressure on the driver vendor to fix the bug.

Which exception does the driver throw? Is it a SQLException or something else?
Can I catch SQLException instead of Excepton?
Comment 2 clover 2006-05-22 08:40:49 UTC
Ok, thanks.

This is SQLException:

java.sql.SQLException: [NCR][Teradata JDBC Driver]:TeraResultSetMetaData: 
function not supported in this version
	at com.ncr.teradata.ComUtil.ThrowExcp(Unknown Source)
	at com.ncr.teradata.TeraResultSetMetaData.isWritable(Unknown Source)
	at 
org.netbeans.modules.db.sql.execute.ResultSetTableModelSupport.createColumnDefs
(ResultSetTableModelSupport.java:370)
	at org.netbeans.modules.db.sql.execute.ui.ResultSetTableModel.<init>
(ResultSetTableModel.java:52)
Comment 3 Andrei Badea 2006-05-23 13:00:15 UTC
Fixed. Thank you for the info.

Checking in src/org/netbeans/modules/db/sql/execute/ResultSetTableModelSupport.java;
/cvs/db/core/src/org/netbeans/modules/db/sql/execute/ResultSetTableModelSupport.java,v
 <--  ResultSetTableModelSupport.java
new revision: 1.2.2.3.2.3; previous revision: 1.2.2.3.2.2
done