this seems rather strange and I would suspect a problem in the JDBC driver.
Can you send the workbench.log file to the support email, then I'll have a look at this.
Regards
Thomas
tpwu, 08.11.2011 20:49:
As far as I can tell, the driver "lies" about what it is able to return after running a DML statement. I can implement a workaround for this.
If you have the possibilitiy, you should also contact Vertica about their driver. It seems that driver is lacking basic JDBC compliance.
(I also got a report from another user reporting that the driver wouldn't return column information for views in the DbExplorer)
Unfortunately they do not offer a free download (not even a trial), so I'm limited in what I can do...
Regards
Thomas
tpwu, 15.11.2011 16:23:
> Just checked their website, they seem offering free trial at
> http://www.vertica.com/evaluate/
There is no direct download there. When you submit the contact form you get an email from a Sales person which in turn wants to contact you via phone (most probably to give you all that sales gibberish). As much as I can understand this from a commercial point of view, I do not want to go through a "sales pitch" just to test it.
> Interestingly, other jdbc tools, e.g. execute query, and our internal applications do not experience the issue.
It is a combination of things.
SQL Workbench supports DML statements that return a result set (e.g. in PostgreSQL "DELETE FROM foo WHERE bar = 1 RETURN *), therefor it does not use Statement.executeUpdate() to run them, but the more generic Statement.execute().
In order to process any result set returned by the driver I'm relying on three different things: the boolean value returned by Statement.execute(), and the values returned by Statement.getUpdateCount() and Statement.getMoreResults().
The logic I'm applying is basically the one that is described in the Javadocs for Statement.getMoreResults:
http://download.oracle.com/javase/6/docs/api/java/sql/Statement.html#getMoreResults%28%29
There are no more results when the following is true:
((stmt.getMoreResults() == false) && (stmt.getUpdateCount() == -1))
So what I'm doing (more or less) is the following:
boolean hasResult = stmt.execute("delete from foo where id = 1");
if (hasResult)
{
ResultSet rs = stmt.getResultSet();
while (rs.next())
{
// process row data
}
rs.close();
}
int updateCount = stmt.getUpdateCount();
boolean moreResults = stmt.getMoreResults();
if (moreResults || updateCount != -1)
{
if (updateCount != -1)
{
// increase counter for updates
}
else
{
// does have another result
ResultSet rs = stmt.getResultSet();
while (rs.next())
{
// process row data, this is where the Vertica driver bombs out.
}
rs.close();
}
updateCount = stmt.getUpdateCount();
moreResults = stmt.getMoreResults();
}
as far as I can tell, the Vertica driver claims that there are more results (returning true from the getMoreResults call) but than bombs out when I try to process the result set that is obtained using getResultSet()
If you can compile and run Java programs, I'd be glad if you can run a sample program that works like the above and verify that this combination of calls does not work.
This would not be the first driver which does not comply with the contract for getMoreResults() and getUpdateCount()...
I could implement a workaround to use executeUpdate() instead, but that only makes sense if this is really the cause (actually if that is the case, Vertica should fix their driver ;) )
Regards
Thomas
> I could implement a workaround to use executeUpdate() instead
That option is already there ;)
Can you please set the following property in workbench.settings
workbench.db.vertica_database.dml.supports.results=false
and try to run the statement again?
Please close the SQL Workbench before editing the .settings file. You can add the line anywhere in the file.
Regards
Thomas
Thomas Kellerer, 16.11.2011 17:24:
Regards
Thomas
tpwu, 16.11.2011 22:24:
workbench.db.vertica_database.dml.supports.results=true
but not if you added
workbench.db.vertica_database.dml.supports.results=false
Can you please verify that that property is in your workbench.settings
The exact location of the file is shown in the options and about dialog
Please make sure to stop the application before editing the file
Regards
Thomas
Regards
Thomas
Regards
Thomas