Re: [dba-dev] writing a new SDBC(X) driver, similar to the MySQL driver

2008-06-10 Thread Ocke Janssen

Hi Micha,

Michael Strobel wrote:

Hi Ocke,

  

After save the table we ask the db metadata with getTabes and the
parameter filled for the table we saved. May be that doesn't return no
information. When you do a refresh it is mostly like creating a new
connection.



Thanks, that helped, at least a bit. The problem results from the Ingres
behavior with identifier case sensitivity. While Ingres treats quoted
identifiers per default as case insensitive, ANSI/ISO Entry SQL-92
specifies quoted identifiers as case sensitive. Open Office uses quoted
identifiers and always expects them to be ANSI/ISO Entry SQL-92
compliant.

Open Office builds a create table statement with quoted identifiers in
mixed case, so the table name is mixed case in Open Office and in lower
case in Ingres. Afterwards Open Office tries to fetch a description of
the table for updating it's list of available tables using
DatabaseMetaData.getTables() and passes the tableNamePattern in mixed
case. DatabaseMetaData.getTables() builds a query against the catalogs
that hence includes the table name in mixed case in a like comparison.
As the table name is stored in the catalogs as lower case the like
comparison fails and an empty result is returned, so the newly created
table doesn't appear in Open Office list of available tables.

I tried to perform a toAsciiLowerCase() on the table name string before
getTables() is called. This results in an update of the tree view in the
OO Base main window, but the table name appears in the tree view as
mixed case, opening the table shows no editable columns and reopening
the table design shows no columns at all. An extra call of
Catalog.refreshTables() after creating the table also didn't do a
correct refresh. Could I do anything else in the driver to repair this?
  
You also have to check getColums, getPrimaryKey, getExportedKeys and all 
occurrences where a table or column name can be asked for.
The best way is to look at the databasemetedata where a resultset is 
returned.


Best regards,

Ocke

Best regards,
Micha

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

  



--
Ocke Janssen  Tel: +49 40 23646 661, x1
Dipl. Inf(FH) Fax: +49 40 23646 550
Sun Microsystems Inc.
Nagelsweg 55 mailto:[EMAIL PROTECTED]
D-20097 Hamburg   http://www.sun.com/staroffice

Sitz der Gesellschaft: Sun Microsystems GmbH, Sonnenallee 1, 
D-85551 Kirchheim-Heimstetten

Amtsgericht Muenchen: HRB 161028
Geschaeftsfuehrer: Thomas Schroeder Wolfgang Engels, Dr. Roland Boemer
Vorsitzender des Aufsichtsrates: Martin Haering



RE: [dba-dev] writing a new SDBC(X) driver, similar to the MySQL driver

2008-06-10 Thread Michael Strobel
Hi Ocke,

> After save the table we ask the db metadata with getTabes and the
> parameter filled for the table we saved. May be that doesn't return no
> information. When you do a refresh it is mostly like creating a new
> connection.

Thanks, that helped, at least a bit. The problem results from the Ingres
behavior with identifier case sensitivity. While Ingres treats quoted
identifiers per default as case insensitive, ANSI/ISO Entry SQL-92
specifies quoted identifiers as case sensitive. Open Office uses quoted
identifiers and always expects them to be ANSI/ISO Entry SQL-92
compliant.

Open Office builds a create table statement with quoted identifiers in
mixed case, so the table name is mixed case in Open Office and in lower
case in Ingres. Afterwards Open Office tries to fetch a description of
the table for updating it's list of available tables using
DatabaseMetaData.getTables() and passes the tableNamePattern in mixed
case. DatabaseMetaData.getTables() builds a query against the catalogs
that hence includes the table name in mixed case in a like comparison.
As the table name is stored in the catalogs as lower case the like
comparison fails and an empty result is returned, so the newly created
table doesn't appear in Open Office list of available tables.

I tried to perform a toAsciiLowerCase() on the table name string before
getTables() is called. This results in an update of the tree view in the
OO Base main window, but the table name appears in the tree view as
mixed case, opening the table shows no editable columns and reopening
the table design shows no columns at all. An extra call of
Catalog.refreshTables() after creating the table also didn't do a
correct refresh. Could I do anything else in the driver to repair this?

Best regards,
Micha

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]