Subject Groovy + Firebird not working.
Author Q
Hi,

I have been unable to get groovy to function correctly with Firebird's
JDBC driver (I tried both 1.5.5 release package and HEAD from CVS). I
have tested using mysql with the same code and it works fine.

I haven't been able to find anything about people successfully using
groovy with firebird, more specifically groovy's groovy.sql.Sql
library with firebird's JDBC driver. Has anyone done this
successfully?

The problem is that no results are returned when doing a select query,
and the following code returns 0 when it should return 3 (there are 3
rows in this table):

import groovy.sql.Sql

url = 'jdbc:firebirdsql:localhost/3050:test'
driver = 'org.firebirdsql.jdbc.FBDriver'
user = 'SYSDBA'
password = 'masterkey'

sql = Sql.newInstance(url, user, password, driver)

sql.eachRow('select count(*) from SALES_CATALOG') { row |
println row[0]
}

Using exactly the same system setup (OSX running the latest FB as SS)
the following jython code works perfectly:

from com.ziclix.python.sql import zxJDBC
url = 'jdbc:firebirdsql:localhost/3050:test'
driver = 'org.firebirdsql.jdbc.FBDriver'
user = 'SYSDBA'
password = 'masterkey'

db = zxJDBC.connect( url, user, password, driver )
cursor = db.cursor()
cursor.execute( 'SELECT * FROM SALES_CATALOG' )
for field in cursor.description : print field
cursor.close()
db.commit()
db.close()

I have had a look through the groovy.sql.Sql library, and traced the
JDBC calls with p6spy and can't seem to find anything specific that
might be causing this problem. All the groovy.Sql class does is get a
resultSet object from a Statement.executeQuery() call, and iterate
over it using ResultSet.next(), passing ResultSet to the closure each
time until ResultSet.next() returns false. Is there anything wrong
with doing this when using Jaybird?

Any help would be greatly appreciated

--
Seeya...Q

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

_____ / Quinton Dolan - qdolan@...
__ __/ / / __/ / /
/ __ / _/ / / Gold Coast, QLD, Australia
__/ __/ __/ ____/ / - / Ph: +61 419 729 806
_______ /
_\