Skip to content

Commit

Permalink
new version 1.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
prrvchr committed May 30, 2024
1 parent 75be63e commit 0689dba
Show file tree
Hide file tree
Showing 25 changed files with 156 additions and 137 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -507,11 +507,11 @@ Clients using the jdbcDriverOOo driver can access features of the underlying JDB

### What has been done for version 1.3.3:

- [Modification of the handling][111] of the `JavaDriverClassPath` connection parameter. This parameter can now designate a directory and in this case all contained jar files will be added to the `Java ClassPath`. This allows dynamic loading of JDBC drivers requiring multiple archives (ie: Derby and Jaybird embedded).
- Resumed part of the implementation of `javax.sql.rowset.CachedRowSet` in ResultSet [sdbcx.RowSetSuper][112] in order to simulate the type `TYPE_SCROLL_SENSITIVE` from ResultSet of type `TYPE_FORWARD_ONLY`. This allows LibreOffice Base to use bookmarks (ie: the UNO interface [XRowLocate][104]) which allow positioned insertions, updates and deletions and therefore, for databases supporting it, the possibility of edit tables containing no primary key. This implementation progressively loading the entire ResultSet data into memory can result in a memory overflow. Implementing paging will eliminate this risk.
- [Modification of the handling][111] of the `JavaDriverClassPath` connection parameter. This parameter can now designate a directory and in this case all contained jar files will be added to the `Java ClassPath`. This allows dynamic loading of JDBC drivers requiring multiple archives (ie: Derby and Jaybird embedded). This change was made to allow the new [JaybirdOOo][112] extension to work.
- Resumed part of the implementation of `javax.sql.rowset.CachedRowSet` in ResultSet [sdbcx.RowSetSuper][113] in order to simulate the type `TYPE_SCROLL_SENSITIVE` from ResultSet of type `TYPE_FORWARD_ONLY`. This allows LibreOffice Base to use bookmarks (ie: the UNO interface [XRowLocate][104]) which allow positioned insertions, updates and deletions and therefore, for databases supporting it, the possibility of edit tables containing no primary key. This implementation progressively loading the entire ResultSet data into memory can result in a memory overflow. Implementing paging will eliminate this risk.
- Added MySQL Connector/J version 8.4.0 driver. This driver does not seem to work correctly, quite surprising errors appear... I leave it in place in case people are ready to participate in its integration? Use with caution.
- Following the request from [PeterSchmidt23][113] addition of the driver [Trino][114] version 448. Not knowing Trino, which also looks amazing, no integration has yet been carried out. Use with caution.
- The implementation of `CachedRowSet` seems to have solved the problem of inserting cells from Calc, see [issue #7][115].
- Following the request from [PeterSchmidt23][114] addition of the driver [Trino][115] version 448. Not knowing Trino, which also looks amazing, only the beginning of integration has been achieved. Use with caution.
- The implementation of `CachedRowSet` seems to have solved the problem of inserting cells from Calc, see [issue #7][116].
- Many corrections and improvements...

### What remains to be done for version 1.3.3:
Expand Down Expand Up @@ -623,7 +623,8 @@ Clients using the jdbcDriverOOo driver can access features of the underlying JDB
[109]: <https://hsqldb.org/doc/guide/texttables-chapt.html#ttc_table_definition>
[110]: <https://github.com/prrvchr/jdbcDriverOOo/blob/master/source/jdbcDriverOOo/source/io/github/prrvchr/uno/sdbc/DriverBase.java#L185>
[111]: <https://github.com/prrvchr/jdbcDriverOOo/blob/master/source/jdbcDriverOOo/source/io/github/prrvchr/uno/sdbc/DriverBase.java#L395>
[112]: <https://github.com/prrvchr/jdbcDriverOOo/blob/master/source/jdbcDriverOOo/source/io/github/prrvchr/uno/sdbcx/RowSetSuper.java#L96>
[113]: <https://github.com/prrvchr/jdbcDriverOOo/issues/8>
[114]: <https://trino.io/>
[115]: <https://github.com/prrvchr/jdbcDriverOOo/issues/7>
[112]: <https://prrvchr.github.io/JaybirdOOo/>
[113]: <https://github.com/prrvchr/jdbcDriverOOo/blob/master/source/jdbcDriverOOo/source/io/github/prrvchr/uno/sdbcx/RowSetSuper.java#L96>
[114]: <https://github.com/prrvchr/jdbcDriverOOo/issues/8>
[115]: <https://trino.io/>
[116]: <https://github.com/prrvchr/jdbcDriverOOo/issues/7>
17 changes: 9 additions & 8 deletions README_fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -507,11 +507,11 @@ Les clients utilisant le pilote jdbcDriverOOo peuvent accéder aux fonctionnalit

### Ce qui a été fait pour la version 1.3.3:

- [Modification de la gestion][111] du paramètre de connexion `JavaDriverClassPath`. Ce paramètre peut désormais désigner un répertoire et dans ce cas tous les fichiers jar contenus seront ajoutés au `Java ClassPath`. Cela permet le chargement dynamique des pilotes JDBC nécessitant plusieurs archives (ie: Derby et Jaybird embedded).
- Reprise d'une partie de l'implémentation de `javax.sql.rowset.CachedRowSet` dans les jeux de résultats [sdbcx.RowSetSuper][112] afin de simuler le type `TYPE_SCROLL_SENSITIVE` à partir de jeux de résultats de type `TYPE_FORWARD_ONLY`. Cela permet à LibreOffice Base d'utiliser des signets (ie: l'interface UNO [XRowLocate][104]) qui permettent des insertions, mises à jour et suppressions positionnées et donc, pour les bases de données le supportant, la possibilité d'éditer des tables ne contenant aucune clé primaire. Cette implémentation chargeant progressivement l’intégralité des données du jeu de résultats en mémoire peut entraîner un débordement de mémoire. La mise en œuvre d'une pagination éliminera ce risque.
- [Modification de la gestion][111] du paramètre de connexion `JavaDriverClassPath`. Ce paramètre peut désormais désigner un répertoire et dans ce cas tous les fichiers jar contenus seront ajoutés au `Java ClassPath`. Cela permet le chargement dynamique des pilotes JDBC nécessitant plusieurs archives (ie: Derby et Jaybird embedded). Cette modification a été apportée pour permettre à la nouvelle extension [JaybirdOOo][112] de fonctionner.
- Reprise d'une partie de l'implémentation de `javax.sql.rowset.CachedRowSet` dans les jeux de résultats [sdbcx.RowSetSuper][113] afin de simuler le type `TYPE_SCROLL_SENSITIVE` à partir de jeux de résultats de type `TYPE_FORWARD_ONLY`. Cela permet à LibreOffice Base d'utiliser des signets (ie: l'interface UNO [XRowLocate][104]) qui permettent des insertions, mises à jour et suppressions positionnées et donc, pour les bases de données le supportant, la possibilité d'éditer des tables ne contenant aucune clé primaire. Cette implémentation chargeant progressivement l’intégralité des données du jeu de résultats en mémoire peut entraîner un débordement de mémoire. La mise en œuvre d'une pagination éliminera ce risque.
- Ajout du pilote MySQL Connector/J version 8.4.0. Ce driver ne semble pas fonctionner correctement, des erreurs assez surprenantes apparaissent... Je le laisse en place au cas où des gens seraient prêts à participer à son intégration? A utiliser avec précaution.
- Suite à la demande de [PeterSchmidt23][113] ajout du pilote [Trino][114] version 448. Ne connaissant pas Trino, qui a l'air étonnant par ailleur, aucune intégration n'a encore été réalisée. A utiliser avec précaution.
- L'implémentation de `CachedRowSet` semble avoir résolu le problème d'insertion de cellules depuis Calc, voir [dysfonctionnement #7][115].
- Suite à la demande de [PeterSchmidt23][114] ajout du pilote [Trino][115] version 448. Ne connaissant pas Trino, qui a l'air étonnant par ailleur, seulement un début d'intégration a été réalisée. A utiliser avec précaution.
- L'implémentation de `CachedRowSet` semble avoir résolu le problème d'insertion de cellules depuis Calc, voir [dysfonctionnement #7][116].
- De nombreuses corrections et améliorations...

### Que reste-t-il à faire pour la version 1.3.3:
Expand Down Expand Up @@ -623,7 +623,8 @@ Les clients utilisant le pilote jdbcDriverOOo peuvent accéder aux fonctionnalit
[109]: <https://hsqldb.org/doc/guide/texttables-chapt.html#ttc_table_definition>
[110]: <https://github.com/prrvchr/jdbcDriverOOo/blob/master/source/jdbcDriverOOo/source/io/github/prrvchr/uno/sdbc/DriverBase.java#L185>
[111]: <https://github.com/prrvchr/jdbcDriverOOo/blob/master/source/jdbcDriverOOo/source/io/github/prrvchr/uno/sdbc/DriverBase.java#L395>
[112]: <https://github.com/prrvchr/jdbcDriverOOo/blob/master/source/jdbcDriverOOo/source/io/github/prrvchr/uno/sdbcx/RowSetSuper.java#L96>
[113]: <https://github.com/prrvchr/jdbcDriverOOo/issues/8>
[114]: <https://trino.io/>
[115]: <https://github.com/prrvchr/jdbcDriverOOo/issues/7>
[112]: <https://prrvchr.github.io/JaybirdOOo/README_fr>
[113]: <https://github.com/prrvchr/jdbcDriverOOo/blob/master/source/jdbcDriverOOo/source/io/github/prrvchr/uno/sdbcx/RowSetSuper.java#L96>
[114]: <https://github.com/prrvchr/jdbcDriverOOo/issues/8>
[115]: <https://trino.io/>
[116]: <https://github.com/prrvchr/jdbcDriverOOo/issues/7>
1 change: 1 addition & 0 deletions source/jdbcDriverOOo/Options.xcs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<prop oor:name="DriverService" oor:type="xs:string"/>
<prop oor:name="ConnectionService" oor:type="xs:string"/>
<prop oor:name="ShowSystemTable" oor:type="xs:boolean"/>
<prop oor:name="SupportTransaction" oor:type="xs:boolean"/>
<prop oor:name="UseBookmark" oor:type="xs:boolean"/>
<prop oor:name="AdminGridColumns" oor:type="xs:string"/>
<prop oor:name="AdminGridOrders" oor:type="xs:string"/>
Expand Down
3 changes: 3 additions & 0 deletions source/jdbcDriverOOo/Options.xcu
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
<prop oor:name="ShowSystemTable" oor:op="fuse">
<value>false</value>
</prop>
<prop oor:name="SupportTransaction" oor:op="fuse">
<value>true</value>
</prop>
<prop oor:name="UseBookmark" oor:op="fuse">
<value>true</value>
</prop>
Expand Down
3 changes: 2 additions & 1 deletion source/jdbcDriverOOo/resource/Driver_en_US.properties
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@

11200=%s: creating <DatabaseMetaData>.
11201=%s: created <DatabaseMetaData>, id: %s
11202=%s: JDBC driver version: %s

11250=%s: JDBC driver version: %s
11250=%s: executing DDL or DCL query: %s

11300=%s: creating <Statement>.
11301=%s: created <Statement>, id: %s
Expand Down
3 changes: 2 additions & 1 deletion source/jdbcDriverOOo/resource/Driver_fr_FR.properties
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@

11200=%s: création de <DatabaseMetaData>.
11201=%s: <DatabaseMetaData> créé, id: %s
11202=%s: JDBC version du pilote: %s

11250=%s: JDBC version du pilote: %s
11250=%s: execute une requête DDL ou DCL: %s

11300=%s: création d'un <Statement>.
11301=%s: <Statement> créé, id: %s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ public String getDropUserQuery(ConnectionBase connection,

public boolean acceptsURL(String url);

public Properties getJavaConnectionProperties(PropertyValue[] infos);
public Properties getJdbcConnectionProperties(PropertyValue[] infos);

public Object getConnectionProperties(PropertyValue[] infos,
String name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ public void setConnection(XInterface source,
throws SQLException
{
try {
System.out.println("DriverProvider.getJavaConnectionProperties() 1");
System.out.println("DriverProvider.setConnection() 1");
m_infos = infos;
// XXX: SQLCommandSuffix is needed for building query from sql command.
m_SQLCommandSuffix = getDriverStringProperty(config1, "SQLCommandSuffix", m_SQLCommandSuffix);
Expand Down Expand Up @@ -758,7 +758,8 @@ public void setConnection(XInterface source,
m_usebookmark = UnoHelper.getConfigurationOption(config2, "UseBookmark", true);
m_enhanced = enhanced;
String url = getConnectionUrl(location, level);
java.sql.Connection connection = DriverManager.getConnection(url, getJavaConnectionProperties(infos));
java.sql.Connection connection = DriverManager.getConnection(url, getJdbcConnectionProperties(infos));
System.out.println("DriverProvider.setConnection() 2");
java.sql.DatabaseMetaData metadata = connection.getMetaData();

m_CatalogsInTableDefinitions = metadata.supportsCatalogsInTableDefinitions();
Expand All @@ -772,7 +773,8 @@ public void setConnection(XInterface source,
m_CatalogsInPrivilegeDefinitions = metadata.supportsCatalogsInPrivilegeDefinitions();
m_SchemasInPrivilegeDefinitions = metadata.supportsSchemasInPrivilegeDefinitions();

m_SupportsTransactions = metadata.supportsTransactions();
boolean support = UnoHelper.getConfigurationOption(config2, "SupportTransaction", true);
m_SupportsTransactions = metadata.supportsTransactions() && support;
m_IsCatalogAtStart = metadata.isCatalogAtStart();
m_CatalogSeparator = metadata.getCatalogSeparator();
m_IdentifierQuoteString = metadata.getIdentifierQuoteString();
Expand All @@ -781,7 +783,7 @@ public void setConnection(XInterface source,
// XXX: We do not keep the connection but the statement
// XXX: which allows us to find the connection if necessary.
m_statement = connection.createStatement();
System.out.println("DriverProvider.getJavaConnectionProperties() 3");
System.out.println("DriverProvider.setConnection() 3");
}
catch (java.sql.SQLException e) {
int resource = Resources.STR_LOG_NO_SYSTEM_CONNECTION;
Expand Down Expand Up @@ -957,68 +959,80 @@ public String getConnectionUrl(String location,
}

@Override
public Properties getJavaConnectionProperties(PropertyValue[] infos)
public Properties getJdbcConnectionProperties(PropertyValue[] infos)
{
// XXX: These are properties used internally by LibreOffice,
// XXX: and should not be passed to the JDBC driver
// XXX: (which probably does not know anything about them anyway).
// XXX: see: connectivity/source/drivers/jdbc/tools.cxx createStringPropertyArray()
Properties properties = new Properties();
for (PropertyValue info : infos) {
if (info.Name.equals("JavaDriverClass") ||
info.Name.equals("JavaDriverClassPath") ||
info.Name.equals("SystemProperties") ||
info.Name.equals("CharSet") ||
info.Name.equals("AppendTableAliasName") ||
info.Name.equals("AppendTableAliasInSelect") ||
info.Name.equals("DisplayVersionColumns") ||
info.Name.equals("GeneratedValues") ||
info.Name.equals("UseIndexDirectionKeyword") ||
info.Name.equals("UseKeywordAsBeforeAlias") ||
info.Name.equals("AddIndexAppendix") ||
info.Name.equals("FormsCheckRequiredFields") ||
info.Name.equals("GenerateASBeforeCorrelationName") ||
info.Name.equals("EscapeDateTime") ||
info.Name.equals("ParameterNameSubstitution") ||
info.Name.equals("IsPasswordRequired") ||
info.Name.equals("IsAutoRetrievingEnabled") ||
info.Name.equals("AutoRetrievingStatement") ||
info.Name.equals("UseCatalogInSelect") ||
info.Name.equals("UseSchemaInSelect") ||
info.Name.equals("AutoIncrementCreation") ||
info.Name.equals("RowVersionCreation") ||
info.Name.equals("Extension") ||
info.Name.equals("NoNameLengthLimit") ||
info.Name.equals("EnableSQL92Check") ||
info.Name.equals("EnableOuterJoinEscape") ||
info.Name.equals("BooleanComparisonMode") ||
info.Name.equals("IgnoreCurrency") ||
info.Name.equals("TypeInfoSettings") ||
info.Name.equals("IgnoreDriverPrivileges") ||
info.Name.equals("ImplicitCatalogRestriction") ||
info.Name.equals("ImplicitSchemaRestriction") ||
info.Name.equals("SupportsTableCreation") ||
info.Name.equals("UseJava") ||
info.Name.equals("Authentication") ||
info.Name.equals("PreferDosLikeLineEnds") ||
info.Name.equals("PrimaryKeySupport") ||
info.Name.equals("RespectDriverResultSetType") ||
info.Name.equals("TablePrivilegesSettings") ||

info.Name.equals("DriverLoggerLevel") ||
info.Name.equals("InMemoryDataBase") ||
info.Name.equals("Type") ||
info.Name.equals("Url") ||
info.Name.equals("ConnectionService"))
{
String property = info.Name;
if (isLibreOfficeProperty(property) || isInternalProperty(property)) {
continue;
}
System.out.println("DriverProvider.getJavaConnectionProperties() *********************: " + info.Name);
properties.setProperty(info.Name, String.format("%s", info.Value));
System.out.println("DriverProvider.getJdbcConnectionProperties() ********************* Name: " + property);
properties.setProperty(property, String.format("%s", info.Value));
System.out.println("DriverProvider.getJdbcConnectionProperties() ********************* Value: " + info.Value);
}
return properties;
}

private boolean isLibreOfficeProperty(String property)
{
// XXX: These are properties used internally by LibreOffice,
// XXX: and should not be passed to the JDBC driver
// XXX: (which probably does not know anything about them anyway).
// XXX: see: connectivity/source/drivers/jdbc/tools.cxx createStringPropertyArray()
return property.equals("JavaDriverClass") ||
property.equals("JavaDriverClassPath") ||
property.equals("SystemProperties") ||
property.equals("CharSet") ||
property.equals("AppendTableAliasName") ||
property.equals("AppendTableAliasInSelect") ||
property.equals("DisplayVersionColumns") ||
property.equals("GeneratedValues") ||
property.equals("UseIndexDirectionKeyword") ||
property.equals("UseKeywordAsBeforeAlias") ||
property.equals("AddIndexAppendix") ||
property.equals("FormsCheckRequiredFields") ||
property.equals("GenerateASBeforeCorrelationName") ||
property.equals("EscapeDateTime") ||
property.equals("ParameterNameSubstitution") ||
property.equals("IsPasswordRequired") ||
property.equals("IsAutoRetrievingEnabled") ||
property.equals("AutoRetrievingStatement") ||
property.equals("UseCatalogInSelect") ||
property.equals("UseSchemaInSelect") ||
property.equals("AutoIncrementCreation") ||
property.equals("Extension") ||
property.equals("NoNameLengthLimit") ||
property.equals("EnableSQL92Check") ||
property.equals("EnableOuterJoinEscape") ||
property.equals("BooleanComparisonMode") ||
property.equals("IgnoreCurrency") ||
property.equals("TypeInfoSettings") ||
property.equals("IgnoreDriverPrivileges") ||
property.equals("ImplicitCatalogRestriction") ||
property.equals("ImplicitSchemaRestriction") ||
property.equals("SupportsTableCreation") ||
property.equals("UseJava") ||
property.equals("Authentication") ||
property.equals("PreferDosLikeLineEnds") ||
property.equals("PrimaryKeySupport") ||
property.equals("RespectDriverResultSetType");
}

private boolean isInternalProperty(String property)
{
// XXX: These are properties used internally by jdbcDriverOOo,
// XXX: and should not be passed to the JDBC driver
// XXX: (which probably does not know anything about them anyway).
return property.equals("TablePrivilegesSettings") ||
property.equals("RowVersionCreation") ||
property.equals("DriverLoggerLevel") ||
property.equals("InMemoryDataBase") ||
property.equals("Type") ||
property.equals("Url") ||
property.equals("ConnectionService");
}

@Override
public boolean supportCreateUser()
{
Expand Down
Loading

0 comments on commit 0689dba

Please sign in to comment.