Hi Steve,

Let me start with a caveat that I have absolutely NO experience with
hypersonicsql, nor with using that DB with Turbine.

However, your error looks similar to what I was seeing while trying to get
postgresql to run with the example app.  On the sql inserts, I'd get a
NullPointerException while it was inserting the data, ie. when what
was being returned was only an update count.

The bug was in the jdbc driver for postgresql.  I took a VERY quick look 
at the hypersonicsql source, and you might try adding something like this
to org.hsql.jdbcStatement.java, in the getResultSet() method:

  public ResultSet getResultSet() {
    if(Trace.TRACE) Trace.trace();
    if (rSet != null && rSet.isResult())
      return rSet;
    return null;
  }

Please keep in mind I haven't even compiled this, let alone looked at the
implications of this change.  However, this code looks very similar to the
code in the postgresql jdbc driver, where in the case that the result
is an update count, getResultSet() is supposed to return null.  If the
result is an update count, rSet is not null, so you must check for yourself
if it's an update or a result before returning.

It's interesting that ant seems to tickle this bug in jdbc drivers.  The
way it does this is that after executing the sql statement, and checking
the result to see if it's an update count or a result set (so it can print
the "x rows affected." statement), it goes to SQLExec.printResults() 
regardless of the type of result we have.  printResults() then uses
getResultSet() to determine the type of result we have, which should be
OK by the standard.  However, it seems at least these 2 jdbc drivers
don't come with the logic to support this.

The more I reference jdbcStatement.java while writing this, the more
I think that this is at least part of your problem, and this is
the correct solution to that bug (see how execute() handles its 
return code...rSet isn't null on an update count).  If this resolves
your problem, you might want to submit this to the hypersonicsql guys
to fix in their source.

Later
John



------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to