ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brandon Harper" <b.li...@gmail.com>
Subject Abator Introspection Problem When Calling getPrimaryKeys() In JDBC Driver
Date Fri, 28 Apr 2006 16:57:49 GMT
Foreward: I'm new to the list and I mostly just have academic
experience with Java though I've been programming for many years, so
please be gentle.

I'm currently using Abator to introspect a datasource on a fairly
esoteric "database" platfrom called Omnidex.  Omnidex is not really a
database though it does use fairly standard SQL, it's more like a
specialized full-text indexing engine for flat-files.  While it does
have a JDBC driver of which the interface appears to be JDBC
compliant, the underlying methods are pretty poorly implemented.  As
such, some of the methods in the driver to retrieve database meta
information look like this:

public ResultSet getPrimaryKeys(String s, String s1, String s2)
       throws SQLException
       throw new OdxCLJException(25500);

When using Abator to introspect an Omnidex datasource, it obviously
calls the getPrimaryKeys() method for which it ends up throwing an

java -jar abator.jar abator-hunters.xml true

omnidex.client.OdxCLJException: The message 25500 was not found in the
Omnidex e rror message files.
       at omnidex.jdbc.OdxJDBCDatabaseMetaData.getPrimaryKeys(OdxJDBCDatabaseMe
       at org.apache.ibatis.abator.internal.db.DatabaseIntrospector.generateCol
       at org.apache.ibatis.abator.config.AbatorContext.generateFiles(AbatorCon
       at org.apache.ibatis.abator.api.Abator.generate(Abator.java:148)
       at org.apache.ibatis.abator.api.AbatorRunner.main(AbatorRunner.java:64)

Believe it or not primary keys are really not important with this
particular engine since it's mostly used to search fully indexed text
files.  That said, for the most part I'll be using iBatis to do string
searches on various fields rather than worrying about relationships,
keys, etc.

Looking at the Abator sourcecode, it looks like the part of the code
in DatabaseIntrospecter.java at lines 162-165 could be wrapped in a
try/catch block to catch an exception coming back from the JDBC driver
when it calls the getPrimaryKeys() method?  I'm sure I could submit a
patch for this myself, but I thought it would be a very easy fix for
an existing developer with commit access to the project?  I've also
submitted a bug report to the database vendor for this issue, but I
have the feeling it will not be fixed soon if ever...


- Brandon


View raw message