|
From: brian z. <bz...@zi...> - 2002-01-24 03:35:33
|
Greg,
Note: First off, the only FreeTDS driver I found was for
Sybase/SQLServer and seem to be kinda old. I know you mentioned Oracle
but I didn't see any FreeTDS Oracle drivers.
I looked into why you are getting the "Not implemented" exception and
it's a problem with the driver. According to the DB API spec when you
execute a query the library is to build a tuple that describes each
column. This includes information like name, type, nullability and
precision for numeric types. I generate this information by asking
ResultSetMetaData the appropriate questions. FreeTDS has not
implemented at least one, getPrecision(), of these methods for whatever
reason (it's available, other SQLServer/Sybase drivers support it). I
presume when you say it works in straight Java that you never invoke
this method? Here's the stacktrace I get:
java.sql.SQLException: Not implemented
at
com.internetcds.jdbc.tds.ResultSetMetaData.NotImplemented(ResultSetMetaD
ata.java:74)
at
com.internetcds.jdbc.tds.ResultSetMetaData.getPrecision(ResultSetMetaDat
a.java:227)
at com.ziclix.python.sql.Fetch.createDescription(Fetch.java:239)
at com.ziclix.python.sql.StaticFetch.add(Fetch.java:471)
at com.ziclix.python.sql.StaticFetch.add(Fetch.java:457)
at
com.ziclix.python.sql.PyCursor$3.executeSQL(PyCursor.java:507)
at com.ziclix.python.sql.PyCursor.execute(PyCursor.java:533)
at com.ziclix.python.sql.PyCursor.execute(PyCursor.java:502)
...
As you can see trying to build the description results in an exception
and I don't explicitly handle this case (I'm not sure I should/want to).
So, you'll be unable to use the current release of zxJDBC with this
driver. Running my whole test suite (Lib/test/zxjdbc) results in
numerous NotImplemented exceptions before the driver finally just hangs
on one of the metadata queries. I'm not too impressed with this driver
(I am using the latest snapshot dated 3/7/2001).
What I could do for situations like this in the future is three-fold:
(1) Handle each exception and put None in place of the expected value.
(2) Have an optional switch for not creating the description tuple at
all.
(3) Do nothing and let the existing behaviour continue.
I have no real preference, you? This is first driver I've seen not to
support this and it seems to have a number of other unimplemented
features. Unfortunately, zxJDBC is only as good/full-featured/fast as
the JDBC driver being used.
I'm more than happy to implement whatever you want, just tell me what
you need. If you have any other problems please let me know.
thanks,
brian
> -----Original Message-----
> From: jyt...@li...
> [mailto:jyt...@li...] On Behalf Of
> Greg Brondo
> Sent: Tuesday, January 22, 2002 11:08 AM
> To: jyt...@li...
> Subject: [Jython-dev] Trouble with zxJDBC and FreeTDS
> Importance: High
>
>
> I can successfully use FreeTDS with pure Java but when I try
> to execute
> a sql statement ( cur.execute(sql) ) withj zxJDBC and jython
> I receive
> the error "Error: Not implemented [SQLCode: 0]". I do not have this
> problem when using zxJDBC/jython and the Oracle type 4 (thin) driver.
>
> Any Ideas?
>
> Thanks!
> Greg B.
>
>
> _______________________________________________
> Jython-dev mailing list
> Jyt...@li...
> https://lists.sourceforge.net/lists/listinfo/j> ython-dev
>
|