to: Glenn Griffin (E-mail)
cc: 'squ...@li...'
Hi Glenn,
I've found a problem with CLOB/BLOB handling in beta6 and am unsure of
the best way to fix it. When running an SQL SELECT from the SQL tab over
an Oracle table with a CLOB column a ClassCastException is thrown in
net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.DataTypeClob.isE
ditableInCell and
net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.DataTypeClob.isE
ditableInPopup
The "originalValue" argument, instead of containing a ClobDescriptor
object contained a String.
The problem comes from:
net.sourceforge.squirrel_sql.client.session.mainpanel.SQLExecuterTask.proces
sResultSet(ResultSet SQLExecutionInfo)
The problem line is:
rsds.setResultSet(rs);
Which doesn't use your CellComponentFactory class to retrieve data from the
ResultSet. What I did was add the following method to ResultSetDataSet:
public void setSQLResultsResultSet(ResultSet rs)
throws DataSetException
{
setResultSet(rs, null, null, false, true);
}
which mimics your setContentsTabResultSet(...) method and "pretends"
that it is the content tab. Then I replaced the line
rsds.setResultSet(rs);
with
rsds.setSQLResultsResultSet(rs);
in SQLExecuterTask.processResultSe
My major concern with this is if this is going to cause any problems with
editing of data in the SQL results tab. From testing it seems okay.
There is a further change needed. Sometines clob data is coming back as
"<error>"
which is causing the same ClassCastException in
net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.DataTypeClob.isE
ditableInCell and
net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.DataTypeClob.isE
ditableInPopup
Currently I changed them to catch the exception and just return false.
Should
something other than this be done? I.E. replace "<error>" with an
instance of ClobDescriptor?
Sorry for not sending you a diff but I have no decent tools on this PC. If
you're happy with these changes let me know and I'll commit them to CVS.
Thanks
Col
|