[h2] Re: H2 as an odb in LibreOffice Base

2024-04-18 Thread prrvchr
It's done, it's called H2dbOOo <https://prrvchr.github.io/H2dbOOo/> and 
there are two versions:
- 1.0.0 for LibreOffice up to 7.x
- 1.1.0 for LibreOffice 24.2.x or higher

You can create H2 databases only with the mouse (say goodbye to your 
keyboard...)

If you fill a table, you kill LibreOffice, you can verify that H2 is indeed 
ACID.

Good use.



Le lundi 15 avril 2024 à 15:19:01 UTC+2, prrvchr a écrit :

> Hi all,
>
> I am working on an extension allowing access to H2 in LibreOffice in 
> embedded mode.
> This allows you to have your H2 database, these Base Queries and Forms in 
> a single odb file.
>
> In order to be able to manage the privileges I provide at the connection 
> during the creation of the H2 Database a `user` property with the value: SA.
>
> I end up with a user called SA but he is not part of the PUBLIC role and 
> is not capable of assigning privileges.
> If I give the PUBLIC role to SA then everything is back to normal...
> Is this normal?
>
> This new functionality in Base with H2 will give rise to a new extension: 
> H2DatabaseOOo. Would it be possible to use your logo for this new 
> extension?
>
> Thank you for your answers.
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/b77de920-8f0c-4db9-9b51-374a62b2n%40googlegroups.com.


[h2] H2 as an odb in LibreOffice Base

2024-04-15 Thread prrvchr
Hi all,

I am working on an extension allowing access to H2 in LibreOffice in 
embedded mode.
This allows you to have your H2 database, these Base Queries and Forms in a 
single odb file.

In order to be able to manage the privileges I provide at the connection 
during the creation of the H2 Database a `user` property with the value: SA.

I end up with a user called SA but he is not part of the PUBLIC role and is 
not capable of assigning privileges.
If I give the PUBLIC role to SA then everything is back to normal...
Is this normal?

This new functionality in Base with H2 will give rise to a new extension: 
H2DatabaseOOo. Would it be possible to use your logo for this new extension?

Thank you for your answers.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/6bf35692-94ee-406c-99f8-5238e43dd985n%40googlegroups.com.


[h2] LibreOffice Base is capable of administering H2

2024-04-11 Thread prrvchr
Just to inform you that the new version jdbcDriverOOo 1.3.1 
 
is available.

It is capable of administering users, roles and rights on tables. It is 
even possible to differentiate between assigned rights and rights inherited 
from roles.

Please notify me of any malfunction.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/d5c3dfee-d86a-42b2-aea7-8b95c7cc9d77n%40googlegroups.com.


Re: [h2] Re: H2 does not use SYSTEM TABLE in table types

2024-04-10 Thread prrvchr
If we want to be able to offer users intelligent software, we must find 
intelligence where it is found.

In this case, you are the one holding it...

Le mercredi 10 avril 2024 à 16:06:22 UTC+2, prrvchr a écrit :

> > But for you, that would require waiting for a new version to become 
> available, which might take some months.
>
> To be honest, the deadline is not very important, what matters is that 
> ultimately we can offer users a tool (LibreOffice Base) that is easy to use 
> for databases. This is necessary if we want to be able to offer 
> intelligent and communicative functionalities.
>
> > Why is it hard to use the workaround? ie. doing
>
> I already have specific code for H2 because of the type of table named 
> TABLE BASE. If you use H2 in LibreOffice Base with the native JDBC driver 
> you will only see the views, the tables are invisible...
>
> So I have mock java.sql.ResultSet in place allowing me to patch the 
> content in order to satisfy Base.
>
> But in this specific case, it is more complicated for me to be able to 
> overcome this limitation than it is for you. I don't think I can write 
> this in less than 10 lines...
>
> Furthermore I think that any good database management software will be 
> happy to take advantage of such functionality.
>
> Le mercredi 10 avril 2024 à 14:59:05 UTC+2, Noel Grandin a écrit :
>
>> On Wed, 10 Apr 2024 at 13:01, prrvchr  wrote:
>>
>>> > if we _did_ improve it, we would break some downstream libraries (like 
>>> JOOQ and Hibernate), who rely on the values we currently return from that 
>>> method
>>>
>>> Not if you only change the input handling: support the SYSTEM TABLE and 
>>> TABLE types in addition to TABLE BASE in the type given as input to the 
>>> DatabaseMetaData.getTables() method.
>>> I think less than 10 lines of code are necessary
>>>
>>
>> Possibly I am missing something. 
>>
>> I am sure we could do that, and possibly it would have no negative side 
>> effects.
>> But for you, that would require waiting for a new version to become 
>> available, which might take some months.
>>
>> Why is it hard to use the workaround? ie. doing
>>
>> SELECT *, DB_OBJECT_ID('TABLE', TABLE_SCHEMA, TABLE_NAME) < 0 IS_SYSTEM 
>> FROM INFORMATION_SCHEMA.TABLES;
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/108ae991-c028-42c7-a6fc-9e3c07088cc4n%40googlegroups.com.


Re: [h2] Re: H2 does not use SYSTEM TABLE in table types

2024-04-10 Thread prrvchr
> But for you, that would require waiting for a new version to become 
available, which might take some months.

To be honest, the deadline is not very important, what matters is that 
ultimately we can offer users a tool (LibreOffice Base) that is easy to use 
for databases. This is necessary if we want to be able to offer intelligent 
and communicative functionalities.

> Why is it hard to use the workaround? ie. doing

I already have specific code for H2 because of the type of table named 
TABLE BASE. If you use H2 in LibreOffice Base with the native JDBC driver 
you will only see the views, the tables are invisible...

So I have mock java.sql.ResultSet in place allowing me to patch the content 
in order to satisfy Base.

But in this specific case, it is more complicated for me to be able to 
overcome this limitation than it is for you. I don't think I can write this 
in less than 10 lines...

Furthermore I think that any good database management software will be 
happy to take advantage of such functionality.

Le mercredi 10 avril 2024 à 14:59:05 UTC+2, Noel Grandin a écrit :

> On Wed, 10 Apr 2024 at 13:01, prrvchr  wrote:
>
>> > if we _did_ improve it, we would break some downstream libraries (like 
>> JOOQ and Hibernate), who rely on the values we currently return from that 
>> method
>>
>> Not if you only change the input handling: support the SYSTEM TABLE and 
>> TABLE types in addition to TABLE BASE in the type given as input to the 
>> DatabaseMetaData.getTables() method.
>> I think less than 10 lines of code are necessary
>>
>
> Possibly I am missing something. 
>
> I am sure we could do that, and possibly it would have no negative side 
> effects.
> But for you, that would require waiting for a new version to become 
> available, which might take some months.
>
> Why is it hard to use the workaround? ie. doing
>
> SELECT *, DB_OBJECT_ID('TABLE', TABLE_SCHEMA, TABLE_NAME) < 0 IS_SYSTEM 
> FROM INFORMATION_SCHEMA.TABLES;
>
>
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/55b3a0fb-aa38-4036-9d6e-13c47fd3e721n%40googlegroups.com.


Re: [h2] Re: H2 does not use SYSTEM TABLE in table types

2024-04-10 Thread prrvchr
> if we _did_ improve it, we would break some downstream libraries (like 
JOOQ and Hibernate), who rely on the values we currently return from that 
method

Not if you only change the input handling: support the SYSTEM TABLE and 
TABLE types in addition to TABLE BASE in the type given as input to the 
DatabaseMetaData.getTables() method.
I think less than 10 lines of code are necessary
Le mercredi 10 avril 2024 à 13:37:47 UTC+2, prrvchr a écrit :

> Hi Noel,
>
> If this is not appreciated, then I apologize. 
>
> But I'm not paying either and I'm trying to bring some more functionality 
> to LibreOffice Base for H2.
>
> Now if it is forbidden to talk about what is not working and it is 
> preferable to hide behind bogus justifications, I do not think that this is 
> of much interest.
>
> Sometimes it is better to say:
> - Yes this is a limitation of our implementation.
> - Than trying to make people believe that it is JDBC.
>
> Because first of all it's taking me for an imbecile and if you want to be 
> able to improve H2, I think this is the way to follow.
>
> Le mercredi 10 avril 2024 à 12:46:11 UTC+2, Noel Grandin a écrit :
>
>> On Wed, 10 Apr 2024 at 11:00, prrvchr  wrote:
>>
>>> No definitely, JDBC has nothing to do with it. It is your 
>>> implementation which by not differentiating the type of the tables, 
>>> necessarily, does not allow any filtering on the tables. Too bad and I 
>>> don't think it's going to change any time soon since you can't understand 
>>> such a simple thing...
>>>
>>>
>> That kind of comment is uncalled for, and not appreciated. This is not a 
>> commercial product, we do not owe you anything. We do not get paid for 
>> working on this project, nor do we get paid for spending time responding to 
>> issues.
>>
>> Now, Let us examine the proposal.
>>
>> Firstly, yes, it could be improved. But we have already supplied a 
>> workaround that extracts the required information.
>>
>> Secondly, if we _did_ improve it, we would break some downstream 
>> libraries (like JOOQ and Hibernate), who rely on the values we currently 
>> return from that method.
>> We would also likely break the code of various people who use H2.
>>
>>
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/ee37b7d4-ceaa-4272-a3c4-b5be92addc54n%40googlegroups.com.


Re: [h2] Re: H2 does not use SYSTEM TABLE in table types

2024-04-10 Thread prrvchr
Hi Noel,

If this is not appreciated, then I apologize. 

But I'm not paying either and I'm trying to bring some more functionality 
to LibreOffice Base for H2.

Now if it is forbidden to talk about what is not working and it is 
preferable to hide behind bogus justifications, I do not think that this is 
of much interest.

Sometimes it is better to say:
- Yes this is a limitation of our implementation.
- Than trying to make people believe that it is JDBC.

Because first of all it's taking me for an imbecile and if you want to be 
able to improve H2, I think this is the way to follow.

Le mercredi 10 avril 2024 à 12:46:11 UTC+2, Noel Grandin a écrit :

> On Wed, 10 Apr 2024 at 11:00, prrvchr  wrote:
>
>> No definitely, JDBC has nothing to do with it. It is your implementation 
>> which by not differentiating the type of the tables, necessarily, does not 
>> allow any filtering on the tables. Too bad and I don't think it's going 
>> to change any time soon since you can't understand such a simple thing...
>>
>>
> That kind of comment is uncalled for, and not appreciated. This is not a 
> commercial product, we do not owe you anything. We do not get paid for 
> working on this project, nor do we get paid for spending time responding to 
> issues.
>
> Now, Let us examine the proposal.
>
> Firstly, yes, it could be improved. But we have already supplied a 
> workaround that extracts the required information.
>
> Secondly, if we _did_ improve it, we would break some downstream libraries 
> (like JOOQ and Hibernate), who rely on the values we currently return from 
> that method.
> We would also likely break the code of various people who use H2.
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/05108935-4025-4f10-815c-5ade0b3b8497n%40googlegroups.com.


[h2] Re: H2 does not use SYSTEM TABLE in table types

2024-04-10 Thread prrvchr
No definitely, JDBC has nothing to do with it. It is your implementation 
which by not differentiating the type of the tables, necessarily, does not 
allow any filtering on the tables. Too bad and I don't think it's going to 
change any time soon since you can't understand such a simple thing...



Le mercredi 10 avril 2024 à 09:37:59 UTC+2, Evgenij Ryazanov a écrit :

> H2 returns table types exactly as required by the SQL Standard. JDBC 
> doesn't have any own requirements.
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/7be7ae7b-e2fb-48f3-ba9d-fecbf10c32f1n%40googlegroups.com.


[h2] Re: H2 does not use SYSTEM TABLE in table types

2024-04-09 Thread prrvchr
Correction: DatabaseMetaData.getTables() method more intelligent...
Le mardi 9 avril 2024 à 18:23:06 UTC+2, prrvchr a écrit :

> To be more precise, it is not a change in the type of tables that I am 
> asking for, but the possibility of making the 
> DatabaseMetaData.getTablesTypes() method more intelligent in order to be 
> able to filter or not the system tables.
> That this method recognizes the types TABLE, SYSTEM TABLE and BASE TABLE 
> in the type parameter in order to only return respectively all non-system 
> tables, all system tables and all tables.
>
>
>
> Le mardi 9 avril 2024 à 18:04:20 UTC+2, prrvchr a écrit :
>
>> Hi Evgenij,
>>
>> All databases use a different type in order to be able to filter system 
>> tables, well all those that I manage in Base (HsqlDB, SQLite xerial, Derby, 
>> PostgreSQL pgJDBC, Firebird Jaybird).
>> MariaDB connector/J gives system tables only for those located in the 
>> information_schema.
>>
>> It seems to me that if this is used by so many databases it is because it 
>> is the simplest solution to provide such functionality.
>>
>> I already have specific code for H2 which returns TABLE BASE instead of 
>> TABLE and I had to set up mock ResultSet on the 
>> DatabaseMetaData.getTypeInfos() and DatabaseMetaData.getTablePrivileges() 
>> methods for databases returning non-compliant resultsets.
>>
>> Unfortunately for this specific problem I can't do much since we are 
>> unable to filter the tables due to lack of differentiation of types... For 
>> this specific functionality I only depend on the underlying implementation.
>>
>> Le mardi 9 avril 2024 à 16:57:51 UTC+2, Evgenij Ryazanov a écrit :
>>
>>> Hi!
>>>
>>> > Why H2 does not use SYSTEM TABLE in the table types returned by the 
>>> DatabaseMetaData.getTableTypes() method
>>>
>>> Because there is no such thing as system table in the SQL Standard. JDBC 
>>> metadata is an entirely unreliable thing, you can't construct anything 
>>> serious on top of it.
>>>
>>> There is a difference between type of a table (base table, view, local 
>>> temporary table, global temporary table and so on) and its actual 
>>> implementation.
>>>
>>> In modern versions of H2 you can use a query like that to distinguish 
>>> user-defined tables and views from system tables and views:
>>>
>>> SELECT *, DB_OBJECT_ID('TABLE', TABLE_SCHEMA, TABLE_NAME) < 0 IS_SYSTEM 
>>> FROM INFORMATION_SCHEMA.TABLES;
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/f9f73d56-7ce1-48d2-ae1c-0332742bc792n%40googlegroups.com.


[h2] Re: H2 does not use SYSTEM TABLE in table types

2024-04-09 Thread prrvchr
To be more precise, it is not a change in the type of tables that I am 
asking for, but the possibility of making the 
DatabaseMetaData.getTablesTypes() method more intelligent in order to be 
able to filter or not the system tables.
That this method recognizes the types TABLE, SYSTEM TABLE and BASE TABLE in 
the type parameter in order to only return respectively all non-system 
tables, all system tables and all tables.



Le mardi 9 avril 2024 à 18:04:20 UTC+2, prrvchr a écrit :

> Hi Evgenij,
>
> All databases use a different type in order to be able to filter system 
> tables, well all those that I manage in Base (HsqlDB, SQLite xerial, Derby, 
> PostgreSQL pgJDBC, Firebird Jaybird).
> MariaDB connector/J gives system tables only for those located in the 
> information_schema.
>
> It seems to me that if this is used by so many databases it is because it 
> is the simplest solution to provide such functionality.
>
> I already have specific code for H2 which returns TABLE BASE instead of 
> TABLE and I had to set up mock ResultSet on the 
> DatabaseMetaData.getTypeInfos() and DatabaseMetaData.getTablePrivileges() 
> methods for databases returning non-compliant resultsets.
>
> Unfortunately for this specific problem I can't do much since we are 
> unable to filter the tables due to lack of differentiation of types... For 
> this specific functionality I only depend on the underlying implementation.
>
> Le mardi 9 avril 2024 à 16:57:51 UTC+2, Evgenij Ryazanov a écrit :
>
>> Hi!
>>
>> > Why H2 does not use SYSTEM TABLE in the table types returned by the 
>> DatabaseMetaData.getTableTypes() method
>>
>> Because there is no such thing as system table in the SQL Standard. JDBC 
>> metadata is an entirely unreliable thing, you can't construct anything 
>> serious on top of it.
>>
>> There is a difference between type of a table (base table, view, local 
>> temporary table, global temporary table and so on) and its actual 
>> implementation.
>>
>> In modern versions of H2 you can use a query like that to distinguish 
>> user-defined tables and views from system tables and views:
>>
>> SELECT *, DB_OBJECT_ID('TABLE', TABLE_SCHEMA, TABLE_NAME) < 0 IS_SYSTEM 
>> FROM INFORMATION_SCHEMA.TABLES;
>>
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/3e6eceb8-cab0-4516-9d35-872eae2828b5n%40googlegroups.com.


[h2] Re: H2 does not use SYSTEM TABLE in table types

2024-04-09 Thread prrvchr
Hi Evgenij,

All databases use a different type in order to be able to filter system 
tables, well all those that I manage in Base (HsqlDB, SQLite xerial, Derby, 
PostgreSQL pgJDBC, Firebird Jaybird).
MariaDB connector/J gives system tables only for those located in the 
information_schema.

It seems to me that if this is used by so many databases it is because it 
is the simplest solution to provide such functionality.

I already have specific code for H2 which returns TABLE BASE instead of 
TABLE and I had to set up mock ResultSet on the 
DatabaseMetaData.getTypeInfos() and DatabaseMetaData.getTablePrivileges() 
methods for databases returning non-compliant resultsets.

Unfortunately for this specific problem I can't do much since we are unable 
to filter the tables due to lack of differentiation of types... For this 
specific functionality I only depend on the underlying implementation.

Le mardi 9 avril 2024 à 16:57:51 UTC+2, Evgenij Ryazanov a écrit :

> Hi!
>
> > Why H2 does not use SYSTEM TABLE in the table types returned by the 
> DatabaseMetaData.getTableTypes() method
>
> Because there is no such thing as system table in the SQL Standard. JDBC 
> metadata is an entirely unreliable thing, you can't construct anything 
> serious on top of it.
>
> There is a difference between type of a table (base table, view, local 
> temporary table, global temporary table and so on) and its actual 
> implementation.
>
> In modern versions of H2 you can use a query like that to distinguish 
> user-defined tables and views from system tables and views:
>
> SELECT *, DB_OBJECT_ID('TABLE', TABLE_SCHEMA, TABLE_NAME) < 0 IS_SYSTEM 
> FROM INFORMATION_SCHEMA.TABLES;
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/ba2b72d8-afdd-4515-bee8-b7f050bfd0b0n%40googlegroups.com.


[h2] Re: Get user's roles and role's users

2024-04-09 Thread prrvchr
Hi,

Thank you for this information, it allowed me to integrate the management 
of roles and rights into Base for H2. I give you the queries that I use, 
this may possibly benefit other people.

Get a user's roles:

SELECT GRANTEDROLE FROM INFORMATION_SCHEMA.RIGHTS WHERE GRANTEETYPE = 
'USER' AND RIGHTS IS NULL AND TABLE_SCHEMA IS NULL AND TABLE_NAME IS NULL 
AND GRANTEE = ?

Get the role's users:

SELECT GRANTEE FROM INFORMATION_SCHEMA.RIGHTS WHERE GRANTEETYPE = 'USER' 
AND RIGHTS IS NULL AND TABLE_SCHEMA IS NULL AND TABLE_NAME IS NULL AND 
GRANTEDROLE = ?

Get the roles of a role:

SELECT GRANTEE FROM INFORMATION_SCHEMA.RIGHTS WHERE GRANTEETYPE = 'ROLE' 
AND RIGHTS IS NULL AND TABLE_SCHEMA IS NULL AND TABLE_NAME IS NULL AND 
GRANTEDROLE = ?

Get rights for a table and a role

SELECT CASE WHEN LOCATE('SELECT', RIGHTS) = 0 THEN 0 ELSE 1 END, CASE WHEN 
LOCATE('INSERT', RIGHTS) = 0 THEN 0 ELSE 2 END, CASE WHEN LOCATE('UPDATE', 
RIGHTS) = 0 THEN 0 ELSE 4 END, CASE WHEN LOCATE('DELETE', RIGHTS) = 0 THEN 
0 ELSE 8 END, CASE WHEN LOCATE('ALL', RIGHTS) = 0 THEN 0 ELSE 15 END FROM 
INFORMATION_SCHEMA.RIGHTS WHERE GRANTEE = ? AND TABLE_SCHEMA = ? AND 
TABLE_NAME = ?

If there are any errors, please correct me...
This will be available in the next version of jdbcDriverOOo 

.
Le dimanche 31 mars 2024 à 04:22:37 UTC+2, Evgenij Ryazanov a écrit :

> Hi!
>
> Take a look on GRANTEE and GRANTEDROLE columns in non-standard 
> INFORMATION_SCHEMA.RIGHTS table where GRANTEETYPE = 'USER' and 
> GRANTEDROLE IS NOT NULL.
>
> Please note that a role can be granted to another role. These records have 
> GRANTEETYPE 
> = 'ROLE' and GRANTEDROLE IS NOT NULL. Users have transitive permissions 
> from these roles.
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/d3b25cde-ebc9-4575-92e2-e2987e4366abn%40googlegroups.com.


[h2] H2 does not use SYSTEM TABLE in table types

2024-04-09 Thread prrvchr
Hi all,

It's just a question. Why H2 does not use SYSTEM TABLE in the table types 
returned by the DatabaseMetaData.getTableTypes() method.

How to filter tables found in system schemas (ie: INFORMATION_SCHEMA) using 
the getTableType() method?

Thank you for your suggestions.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/45570522-bfce-49e7-8740-20420a6fe8a2n%40googlegroups.com.


[h2] Get user's roles and role's users

2024-03-30 Thread prrvchr
Hi all,

I'm looking to get the users of a role as well as the roles of a user.

I can do this with HsqlDB with the following two queries respectivly:

   - SELECT GRANTEE FROM INFORMATION_SCHEMA.ROLE_AUTHORIZATION_DESCRIPTORS 
   WHERE ROLE_NAME=?


   - SELECT ROLE_NAME FROM 
   INFORMATION_SCHEMA.ROLE_AUTHORIZATION_DESCRIPTORS WHERE GRANTEE=? AND 
   ROLE_NAME!=GRANTEE


But I couldn't find anything for H2, thanks for your help...

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/f1cd1730-bbe6-4360-afcd-0e89723e5dc6n%40googlegroups.com.


[h2] H2 as an embedded database in LibreOffice / OpenOffice Base

2023-08-02 Thread prrvchr
It is possible to integrate any JDBC database into LibreOffice or 
OpenOffice Base.

This integration has already been done for the HsqlDB database and SQLite 
JDBC with the HsqlDriverOOo  and 
SQLiteOOo  extension.

I think it is possible to do the same with H2. What do you think about it?

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/9905b634-b8c3-433f-9623-745d707283b5n%40googlegroups.com.


Re: [h2] How to differentiate system tables from others

2023-05-02 Thread prrvchr
no, that doesn't change anything...

Le mardi 2 mai 2023 à 21:30:00 UTC+2, prrvchr a écrit :

> I'll try...
>
> Le mardi 2 mai 2023 à 21:27:22 UTC+2, Noel Grandin a écrit :
>
>> On Tue, 2 May 2023 at 15:30, prrvchr  wrote:
>>
>>> To be more precise: 
>>>  Here is the result of some tests on the DataBaseMetadata.getTables() 
>>> method with the String[] types parameter:
>>>
>>
>> types = new String[] { "BASE TABLE", "VIEW" };
>>
>> Should do what you need
>>
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/5407035b-66ec-472c-99a2-1127b8160e92n%40googlegroups.com.


Re: [h2] How to differentiate system tables from others

2023-05-02 Thread prrvchr
I'll try...

Le mardi 2 mai 2023 à 21:27:22 UTC+2, Noel Grandin a écrit :

> On Tue, 2 May 2023 at 15:30, prrvchr  wrote:
>
>> To be more precise: 
>>  Here is the result of some tests on the DataBaseMetadata.getTables() 
>> method with the String[] types parameter:
>>
>
> types = new String[] { "BASE TABLE", "VIEW" };
>
> Should do what you need
>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/5afe68c1-384e-4b18-adc6-f8dbb8afb260n%40googlegroups.com.


Re: [h2] How to differentiate system tables from others

2023-05-02 Thread prrvchr
Well I would like you to realize that this problem which looks simple, 
trivial and irrefutable, in fact took me a lot of time in order to be able 
to find it, understand it and be able to explain it to you clearly. So sure 
I can patch it, but I think it would be reasonable to assume that your use 
of the type parameter in DataBaseMetadata.getTables() is unusable as 
implemented in your driver. So if you have to talk for three days, in order 
to get three lines of correction code, I give up...

Le mardi 2 mai 2023 à 17:00:02 UTC+2, prrvchr a écrit :

> If needed I can do something specific for H2.
> I have java services for each built-in driver...
>
> But honestly I don't see the point of the Type parameter with the 
> DataBaseMetadata.getTable() method if it treats it of this way...
>
> Le mardi 2 mai 2023 à 16:19:38 UTC+2, prrvchr a écrit :
>
>> I think that if we manage to progress then we will be able to reach the 
>> level of integration of HsqlDB, namely to be able to manage the rights on 
>> the tables...
>>
>> Le mardi 2 mai 2023 à 16:13:27 UTC+2, prrvchr a écrit :
>>
>>> jdbcDriverOOo is a JDBC 4 driver for LibreOffice and OpenOffice.
>>> It is packed with H2 driver 2.2.219 you can try it if you want...
>>>
>>> The problem is that this driver is only an adapter I do not analyze the 
>>> resultset before returning them...
>>>
>>> To solve this problem, I only see a modification of the code of H2.
>>>
>>> Le mardi 2 mai 2023 à 16:04:52 UTC+2, Evgenij Ryazanov a écrit :
>>>
>>>> Do you still have an own special driver for LibreOffice?
>>>>
>>>> If so, you can assume that rows with TABLE_SCHEM = 'INFORMATION_SCHEMA' 
>>>> describe system tables.
>>>>
>>>> (Actually they aren't tables, but it doesn't matter.)
>>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/4d1887db-deb7-4d3e-91f8-eae56c116e66n%40googlegroups.com.


Re: [h2] How to differentiate system tables from others

2023-05-02 Thread prrvchr
If needed I can do something specific for H2.
I have java services for each built-in driver...

But honestly I don't see the point of the Type parameter with the 
DataBaseMetadata.getTable() method if it treats it of this way...

Le mardi 2 mai 2023 à 16:19:38 UTC+2, prrvchr a écrit :

> I think that if we manage to progress then we will be able to reach the 
> level of integration of HsqlDB, namely to be able to manage the rights on 
> the tables...
>
> Le mardi 2 mai 2023 à 16:13:27 UTC+2, prrvchr a écrit :
>
>> jdbcDriverOOo is a JDBC 4 driver for LibreOffice and OpenOffice.
>> It is packed with H2 driver 2.2.219 you can try it if you want...
>>
>> The problem is that this driver is only an adapter I do not analyze the 
>> resultset before returning them...
>>
>> To solve this problem, I only see a modification of the code of H2.
>>
>> Le mardi 2 mai 2023 à 16:04:52 UTC+2, Evgenij Ryazanov a écrit :
>>
>>> Do you still have an own special driver for LibreOffice?
>>>
>>> If so, you can assume that rows with TABLE_SCHEM = 'INFORMATION_SCHEMA' 
>>> describe system tables.
>>>
>>> (Actually they aren't tables, but it doesn't matter.)
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/7fb0d707-ac72-4456-a6af-892f1d7e2956n%40googlegroups.com.


Re: [h2] How to differentiate system tables from others

2023-05-02 Thread prrvchr
I think that if we manage to progress then we will be able to reach the 
level of integration of HsqlDB, namely to be able to manage the rights on 
the tables...

Le mardi 2 mai 2023 à 16:13:27 UTC+2, prrvchr a écrit :

> jdbcDriverOOo is a JDBC 4 driver for LibreOffice and OpenOffice.
> It is packed with H2 driver 2.2.219 you can try it if you want...
>
> The problem is that this driver is only an adapter I do not analyze the 
> resultset before returning them...
>
> To solve this problem, I only see a modification of the code of H2.
>
> Le mardi 2 mai 2023 à 16:04:52 UTC+2, Evgenij Ryazanov a écrit :
>
>> Do you still have an own special driver for LibreOffice?
>>
>> If so, you can assume that rows with TABLE_SCHEM = 'INFORMATION_SCHEMA' 
>> describe system tables.
>>
>> (Actually they aren't tables, but it doesn't matter.)
>>
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/b66894b1-e9c0-4988-8cab-157c2624f14an%40googlegroups.com.


Re: [h2] How to differentiate system tables from others

2023-05-02 Thread prrvchr
jdbcDriverOOo is a JDBC 4 driver for LibreOffice and OpenOffice.
It is packed with H2 driver 2.2.219 you can try it if you want...

The problem is that this driver is only an adapter I do not analyze the 
resultset before returning them...

To solve this problem, I only see a modification of the code of H2.

Le mardi 2 mai 2023 à 16:04:52 UTC+2, Evgenij Ryazanov a écrit :

> Do you still have an own special driver for LibreOffice?
>
> If so, you can assume that rows with TABLE_SCHEM = 'INFORMATION_SCHEMA' 
> describe system tables.
>
> (Actually they aren't tables, but it doesn't matter.)
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/744ee5b5-653b-4112-8449-1724195cdf2bn%40googlegroups.com.


Re: [h2] How to differentiate system tables from others

2023-05-02 Thread prrvchr

In fact, I don't know anything about JDBC and SQL, but I would like H2 to 
work correctly under LibreOffice / OpenOffice, and I think that on this 
specific problem I can't do much without your help.
Le mardi 2 mai 2023 à 15:39:30 UTC+2, prrvchr a écrit :

> And I think that if this is not the case then the type parameter does not 
> have much interest...
>
> Le mardi 2 mai 2023 à 15:37:12 UTC+2, prrvchr a écrit :
>
>> It seems that in order to be able to display only non-system tables, the 
>> DataBaseMetadata.getTables() method must only return system tables if the 
>> list of types includes SYSTEM_TABLE.
>> Apparently that's how it works with HsqlDB and Sqlite.
>>
>> Le mardi 2 mai 2023 à 15:30:38 UTC+2, prrvchr a écrit :
>>
>>> To be more precise: 
>>>  Here is the result of some tests on the DataBaseMetadata.getTables() 
>>> method with the String[] types parameter:
>>>
>>> - String[] types = null;
>>>
>>>- H2 lists all 
>>>- HsqlDB lists all
>>>- SQLite JDBC Driver <https://github.com/xerial/sqlite-jdbc> lists 
>>>all
>>>
>>> - String[] types = new String[]{"TABLE", "VIEW"};
>>>
>>>- H2 lists all
>>>- HsqlDB lists all tables and views except those under schemas: 
>>> INFORMATION_SCHEMA 
>>>and SYSTEM_LOBS
>>>- SQLite JDBC Driver <https://github.com/xerial/sqlite-jdbc> list 
>>>all tables and views except table sqlite_sequence (sqlite as no schema)
>>>
>>> Le mardi 2 mai 2023 à 14:30:26 UTC+2, Pierre Vacher a écrit :
>>>
>>>> Hi,
>>>>
>>>> 2.2.219 is a SNAPSHOT that fixes the problem of autoincrement types if 
>>>> I remember correctly...
>>>>
>>>> In fact the problem is not to find the type of the table, but that the 
>>>> DataBaseMetadata.getTables() method does not know how to filter on the 
>>>> type 
>>>> that normally we must be able to control...
>>>> Maybe I'm wrong...
>>>>
>>>>
>>>> Le mar. 2 mai 2023 à 11:39, Evgenij Ryazanov  a 
>>>> écrit :
>>>>
>>>>> Hi!
>>>>>
>>>>> The latest version of H2 is 2.1.214, there is no such version as 
>>>>> 2.2.219.
>>>>>
>>>>> You can detect types of tables with the following query in modern 
>>>>> versions of H2:
>>>>>
>>>>> SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, STORAGE_TYPE, 
>>>>> DB_OBJECT_SQL('TABLE', TABLE_SCHEMA, TABLE_NAME) IS NULL IS_SYSTEM FROM 
>>>>> INFORMATION_SCHEMA.TABLES;
>>>>>
>>>>> -- 
>>>>> You received this message because you are subscribed to the Google 
>>>>> Groups "H2 Database" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>>> an email to h2-database...@googlegroups.com.
>>>>> To view this discussion on the web visit 
>>>>> https://groups.google.com/d/msgid/h2-database/0c9892ec-4a71-4802-9f21-9ee9fc42da8an%40googlegroups.com
>>>>>  
>>>>> <https://groups.google.com/d/msgid/h2-database/0c9892ec-4a71-4802-9f21-9ee9fc42da8an%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/03468113-4bf1-47bb-9a18-536db05db114n%40googlegroups.com.


Re: [h2] How to differentiate system tables from others

2023-05-02 Thread prrvchr
And I think that if this is not the case then the type parameter does not 
have much interest...

Le mardi 2 mai 2023 à 15:37:12 UTC+2, prrvchr a écrit :

> It seems that in order to be able to display only non-system tables, the 
> DataBaseMetadata.getTables() method must only return system tables if the 
> list of types includes SYSTEM_TABLE.
> Apparently that's how it works with HsqlDB and Sqlite.
>
> Le mardi 2 mai 2023 à 15:30:38 UTC+2, prrvchr a écrit :
>
>> To be more precise: 
>>  Here is the result of some tests on the DataBaseMetadata.getTables() 
>> method with the String[] types parameter:
>>
>> - String[] types = null;
>>
>>- H2 lists all 
>>- HsqlDB lists all
>>- SQLite JDBC Driver <https://github.com/xerial/sqlite-jdbc> lists all
>>
>> - String[] types = new String[]{"TABLE", "VIEW"};
>>
>>- H2 lists all
>>- HsqlDB lists all tables and views except those under schemas: 
>> INFORMATION_SCHEMA 
>>and SYSTEM_LOBS
>>- SQLite JDBC Driver <https://github.com/xerial/sqlite-jdbc> list all 
>>tables and views except table sqlite_sequence (sqlite as no schema)
>>
>> Le mardi 2 mai 2023 à 14:30:26 UTC+2, Pierre Vacher a écrit :
>>
>>> Hi,
>>>
>>> 2.2.219 is a SNAPSHOT that fixes the problem of autoincrement types if 
>>> I remember correctly...
>>>
>>> In fact the problem is not to find the type of the table, but that the 
>>> DataBaseMetadata.getTables() method does not know how to filter on the type 
>>> that normally we must be able to control...
>>> Maybe I'm wrong...
>>>
>>>
>>> Le mar. 2 mai 2023 à 11:39, Evgenij Ryazanov  a 
>>> écrit :
>>>
>>>> Hi!
>>>>
>>>> The latest version of H2 is 2.1.214, there is no such version as 
>>>> 2.2.219.
>>>>
>>>> You can detect types of tables with the following query in modern 
>>>> versions of H2:
>>>>
>>>> SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, STORAGE_TYPE, 
>>>> DB_OBJECT_SQL('TABLE', TABLE_SCHEMA, TABLE_NAME) IS NULL IS_SYSTEM FROM 
>>>> INFORMATION_SCHEMA.TABLES;
>>>>
>>>> -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "H2 Database" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to h2-database...@googlegroups.com.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/h2-database/0c9892ec-4a71-4802-9f21-9ee9fc42da8an%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/h2-database/0c9892ec-4a71-4802-9f21-9ee9fc42da8an%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/70c1aebe-e080-411a-ae48-fa06ee48e81fn%40googlegroups.com.


Re: [h2] How to differentiate system tables from others

2023-05-02 Thread prrvchr
It seems that in order to be able to display only non-system tables, the 
DataBaseMetadata.getTables() method must only return system tables if the 
list of types includes SYSTEM_TABLE.
Apparently that's how it works with HsqlDB and Sqlite.

Le mardi 2 mai 2023 à 15:30:38 UTC+2, prrvchr a écrit :

> To be more precise: 
>  Here is the result of some tests on the DataBaseMetadata.getTables() 
> method with the String[] types parameter:
>
> - String[] types = null;
>
>- H2 lists all 
>- HsqlDB lists all
>- SQLite JDBC Driver <https://github.com/xerial/sqlite-jdbc> lists all
>
> - String[] types = new String[]{"TABLE", "VIEW"};
>
>- H2 lists all
>- HsqlDB lists all tables and views except those under schemas: 
> INFORMATION_SCHEMA 
>and SYSTEM_LOBS
>- SQLite JDBC Driver <https://github.com/xerial/sqlite-jdbc> list all 
>tables and views except table sqlite_sequence (sqlite as no schema)
>
> Le mardi 2 mai 2023 à 14:30:26 UTC+2, Pierre Vacher a écrit :
>
>> Hi,
>>
>> 2.2.219 is a SNAPSHOT that fixes the problem of autoincrement types if I 
>> remember correctly...
>>
>> In fact the problem is not to find the type of the table, but that the 
>> DataBaseMetadata.getTables() method does not know how to filter on the type 
>> that normally we must be able to control...
>> Maybe I'm wrong...
>>
>>
>> Le mar. 2 mai 2023 à 11:39, Evgenij Ryazanov  a écrit :
>>
>>> Hi!
>>>
>>> The latest version of H2 is 2.1.214, there is no such version as 2.2.219.
>>>
>>> You can detect types of tables with the following query in modern 
>>> versions of H2:
>>>
>>> SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, STORAGE_TYPE, 
>>> DB_OBJECT_SQL('TABLE', TABLE_SCHEMA, TABLE_NAME) IS NULL IS_SYSTEM FROM 
>>> INFORMATION_SCHEMA.TABLES;
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "H2 Database" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to h2-database...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/h2-database/0c9892ec-4a71-4802-9f21-9ee9fc42da8an%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/h2-database/0c9892ec-4a71-4802-9f21-9ee9fc42da8an%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/87b5322b-0e69-40e9-ba80-6beb5dded95bn%40googlegroups.com.


Re: [h2] How to differentiate system tables from others

2023-05-02 Thread prrvchr
To be more precise: 
 Here is the result of some tests on the DataBaseMetadata.getTables() 
method with the String[] types parameter:

- String[] types = null;

   - H2 lists all 
   - HsqlDB lists all
   - SQLite JDBC Driver  lists all
   
- String[] types = new String[]{"TABLE", "VIEW"};

   - H2 lists all
   - HsqlDB lists all tables and views except those under schemas: 
INFORMATION_SCHEMA 
   and SYSTEM_LOBS
   - SQLite JDBC Driver  list all 
   tables and views except table sqlite_sequence (sqlite as no schema)
   
Le mardi 2 mai 2023 à 14:30:26 UTC+2, Pierre Vacher a écrit :

> Hi,
>
> 2.2.219 is a SNAPSHOT that fixes the problem of autoincrement types if I 
> remember correctly...
>
> In fact the problem is not to find the type of the table, but that the 
> DataBaseMetadata.getTables() method does not know how to filter on the type 
> that normally we must be able to control...
> Maybe I'm wrong...
>
>
> Le mar. 2 mai 2023 à 11:39, Evgenij Ryazanov  a écrit :
>
>> Hi!
>>
>> The latest version of H2 is 2.1.214, there is no such version as 2.2.219.
>>
>> You can detect types of tables with the following query in modern 
>> versions of H2:
>>
>> SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, STORAGE_TYPE, 
>> DB_OBJECT_SQL('TABLE', TABLE_SCHEMA, TABLE_NAME) IS NULL IS_SYSTEM FROM 
>> INFORMATION_SCHEMA.TABLES;
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "H2 Database" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to h2-database...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/h2-database/0c9892ec-4a71-4802-9f21-9ee9fc42da8an%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/92fbed16-d01b-4411-b472-7e6a90f6fc6en%40googlegroups.com.


Re: [h2] How to differentiate system tables from others

2023-05-02 Thread prrvchr
Hi Noel,

In fact H2 only seems to differentiate tables and views  (TABLE and VIEW) 
but nothing on system tables (SYSTEM TABLE, GLOBAL TEMPORARY, LOCAL 
TEMPORARY, ALIAS, SYNONYM)

I haven't tried again recently, but in 2.2.219 it doesn't work...

Le mardi 2 mai 2023 à 11:00:37 UTC+2, Noel Grandin a écrit :

>
> Assuming you are using the normal API, it's in the TABLE_TYPE column:
>
>
> https://docs.oracle.com/javase/8/docs/api/java/sql/DatabaseMetaData.html#getTables-java.lang.String-java.lang.String-java.lang.String-java.lang.String:A-
>
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/89143a5f-6053-4638-914a-cb66d2b5af99n%40googlegroups.com.


[h2] How to differentiate system tables from others

2023-05-02 Thread prrvchr
I am trying to display the tables of an H2 database but cannot 
differentiate the system tables (generally the tables located under the 
schemas: INFORMATION_SCHEMA, SYSTEM_LOBS, ...) from the others.
How is this possible?

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/c05c799c-128a-4db5-8f8c-da509a48ed97n%40googlegroups.com.


[h2] Re: SELECT command that returns a strange RESULSET

2022-09-05 Thread prrvchr
Newbie mistake, thank you Evgenij Ryazanov,, it took me a while to find the 
malfunction now I understand it.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/b3ea0e9f-7cac-46aa-b102-69f68fd3f5a6n%40googlegroups.com.


Re: [h2] Management of users, roles and privileges in LibreOffice Base

2022-09-05 Thread prrvchr

For further clarification, I would like to confirm that for administration 
in Base of users 
 
and roles 
 
as well as associated privileges 
,
 
I am using UNO API of LibreOffice / OpenOffice. This API was written, I 
think by SUN a long time ago for StarOffice.

Although this API is above SQL and JDBC which actually do not provide an 
administration standard, SUN provides with the UNO API everything that is 
necessary for the administration of a database. It can be considered as a 
standard.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/97e352b3-c5b4-40a2-b793-d2d600eae303n%40googlegroups.com.


[h2] SELECT command that returns a strange RESULSET

2022-09-05 Thread prrvchr
Hi all,

During my tests for the integration of H2 in Base, I unwittingly discovered 
a strange behavior of a SELECT command with an error on the column name.

SELECT USER FROM INFORMATION_SCHEMA.USERS

The correct column name is USER_NAME but this SELECT does not throw an 
SQLException and return a strange ResultSet...


-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/3566915b-f182-4e79-ac76-8f01fa833d82n%40googlegroups.com.


Re: [h2] Management of users, roles and privileges in LibreOffice Base

2022-09-05 Thread prrvchr
A question I forgot to ask:
Can you confirm that the names of users and roles only support uppercase 
characters without double quotes in all the commands where they appear.

Thanks

Le lundi 5 septembre 2022 à 15:11:51 UTC+2, prrvchr a écrit :

> Hi Evgenij Ryazanov,
>
> Le lundi 5 septembre 2022 à 02:34:42 UTC+2, Evgenij Ryazanov a écrit :
>
>> Database administration is out of scope of the SQL Standard and there are 
>> no predefined roles is the Standard. In the Standard, every schema has an 
>> owner and this owner may perform DDL commands within this schema. Anything 
>> else is database-specific.
>
>
>  I know the administration of a database  is out of scope of the SQL 
> Standard. but nothing prevents us from defining one.
> This is the meaning of my first message, which asked you if you were ready 
> to create these new resources.
>
> After many tests and commits, I can now establish the list of these 
> resources / modifications necessary for the integration of H2 
> administration in Base:
>
>- During the first connection, if a new database is to be created and 
>no user is given during this connection, a default username (SA) must be 
>created instead of a empty username. this modification is not 
>obligatory but highly recommended.
>- In order to be able to manage the inheritance of privileges, the 
>tree structure and the users of the roles, it is necessary to create a new 
>view in the schema INFORMATION_SCHEMA making it possible to establish 
> these 
>relations. The creation of this new view is mandatory.
>- In order to be able to manage the privileges of a table that has 
>just been created, a default system role (DBA) must exist and the user 
>created when creating the database must be a member of this role. When 
>creating a new table, all privileges must be assigned to the DBA role 
>(GRANT ALL ON NEWTABLE TO DBA). The creation of this new role is 
>highly recommended.
>
>
> Voila, I think I did my part, the ball is in your court, thank you for 
> your contribution..
>
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/9214889a-2919-4328-989d-8bbba5c13086n%40googlegroups.com.


Re: [h2] Management of users, roles and privileges in LibreOffice Base

2022-09-05 Thread prrvchr
Hi Evgenij Ryazanov,

Le lundi 5 septembre 2022 à 02:34:42 UTC+2, Evgenij Ryazanov a écrit :

> Database administration is out of scope of the SQL Standard and there are 
> no predefined roles is the Standard. In the Standard, every schema has an 
> owner and this owner may perform DDL commands within this schema. Anything 
> else is database-specific.


 I know the administration of a database  is out of scope of the SQL 
Standard. but nothing prevents us from defining one.
This is the meaning of my first message, which asked you if you were ready 
to create these new resources.

After many tests and commits, I can now establish the list of these 
resources / modifications necessary for the integration of H2 
administration in Base:

   - During the first connection, if a new database is to be created and no 
   user is given during this connection, a default username (SA) must be 
   created instead of a empty username. this modification is not obligatory 
   but highly recommended.
   - In order to be able to manage the inheritance of privileges, the tree 
   structure and the users of the roles, it is necessary to create a new view 
   in the schema INFORMATION_SCHEMA making it possible to establish these 
   relations. The creation of this new view is mandatory.
   - In order to be able to manage the privileges of a table that has just 
   been created, a default system role (DBA) must exist and the user 
   created when creating the database must be a member of this role. When 
   creating a new table, all privileges must be assigned to the DBA role 
   (GRANT ALL ON NEWTABLE TO DBA). The creation of this new role is highly 
   recommended.


Voila, I think I did my part, the ball is in your court, thank you for your 
contribution..

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/c66086dc-73bb-4382-b213-a236121c07c3n%40googlegroups.com.


Re: [h2] Management of users, roles and privileges in LibreOffice Base

2022-09-04 Thread prrvchr
Latest jdbcDriverOOo 
<https://github.com/prrvchr/jdbcDriverOOo/raw/master/source/jdbcDriverOOo/dist/jdbcDriverOOo.oxt>
 
commit supports forcing uppercase names of users and roles when creating 
them.

The fact that the INFORMATION_SCHEMA.TABLE_PRIVILEGES table is empty after 
creating a table seems normal because there is no default DBA system role.
And this imposes in Base after the creation of a table, to use menu Tools 
-> SQL to manually execute an SQL command: *GRANT ALL ON "NewTable" TO SA* to 
allow privilege assignment by SA in the user administration GUI 
<https://prrvchr.github.io/jdbcDriverOOo/#managing-users-and-privileges-in-base>
In fact it seems to me that it will be difficult to do without a default 
DBA system role...
Le dimanche 4 septembre 2022 à 20:24:36 UTC+2, prrvchr a écrit :

> By doing a little more testing, I realize that the table 
> INFORMATION_SCHEMA.TABLE_PRIVILEGES has no content...
> It seems to me that I am the administrator (the user who created the 
> database), can someone confirm that this table is indeed empty?
>
> Thanks.
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/e2142404-90e5-427c-ac48-563981acfb15n%40googlegroups.com.


Re: [h2] Management of users, roles and privileges in LibreOffice Base

2022-09-04 Thread prrvchr
By doing a little more testing, I realize that the table 
INFORMATION_SCHEMA.TABLE_PRIVILEGES has no content...
It seems to me that I am the administrator (the user who created the 
database), can someone confirm that this table is indeed empty?

Thanks.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/97d0619c-3531-46df-abf7-62499f45021en%40googlegroups.com.


Re: [h2] Management of users, roles and privileges in LibreOffice Base

2022-09-04 Thread prrvchr
Hi,

After consulting the H2 documentation 
<https://h2database.com/html/tutorial.html#creating_new_databases>, 
java.sql.DatabaseMetaData.getUserName() works if you provide a username on 
the first connection.
I have no way to force provide a username during the Base connection wizard 
(File -> New -> Database -> Connect to an existing database -> H2 Driver) 
but I can specify it in the jdbcDriverOOo 
<https://prrvchr.github.io/jdbcDriverOOo/#how-to-create-a-new-database> 
user documentation.

Le samedi 3 septembre 2022 à 11:38:47 UTC+2, prrvchr a écrit :

> Hi Evgenij Ryazanov,
>
> I am aware of the requirements for this integration into Base. Thank you 
> for answering it, it will be good for the LibreOffice / OpenOffice suites 
> and will make them a little less moribund...
>
> To get the list of users, I now use INFORMATION_SCHEMA.USERS table with 
> the query: SELECT USER FROM INFORMATION_SCHEMA.USERS
>
> To get the list of roles, I can use INFORMATION_SCHEMA.ROLES table with 
> the query: SELECT ROLE_NAME FROM INFORMATION_SCHEMA.ROLES or your can 
> create a new view INFORMATION_SCHEMA.ADMINISTRABLE_ROLE_AUTHORIZATIONS, as 
> it suits you.
>
> To get the hierarchy and users of roles, although I know nothing about 
> it, I believe that there is no defined standard, but I need a view allowing 
> me to establish the tree of roles as well as to know the roles of a user.
>
> I have a problem with java.sql.DatabaseMetaData.getUserName(), it seems 
> to me that it returns a empty or blank user with a database created 
> during the first connection.
>
> I also don't see a like DBA role allowing the administration of privileges 
> and such, it would make things easier if there was one.
>
> Thank you for your contribution.
>
>
> Le samedi 3 septembre 2022 à 06:58:49 UTC+2, Evgenij Ryazanov a écrit :
>
>> Hi!
>>
>> On Friday, 2 September 2022 at 23:40:02 UTC+8 prrvchr wrote:
>>
>>>
>>>- java.sql.DatabaseMetaData.getUserName() should return the user who 
>>>is logged in (current user).
>>>
>>> This method is implemented in H2 itself properly. You can also use 
>> standard CURRENT_USER expression in SQL.
>>
>>
>>>- In order to obtain all the users declared on the database the 
>>>INFORMATION_SCHEMA.SYSTEM_USERS table is used. This table normalized 
>>>by JDBC must list all the users whose current user... The query is: 
>>> SELECT 
>>>USER_NAME FROM INFORMATION_SCHEMA.SYSTEM_USERS
>>>
>>> There is no such table or view in the SQL Standard. INFORMATION_SCHEMA 
>> is not related to JDBC in any way, it is covered only by the SQL Standard, 
>> Part 11: Information and Definition Schemas (SQL/Schemata). H2 has own 
>> non-standard table INFORMATION_SCHEMA.USERS, you need to use it instead.
>>  
>>
>>>
>>>- In order to obtain all the roles declared on the database the 
>>>INFORMATION_SCHEMA.ADMINISTRABLE_ROLE_AUTHORIZATIONS table is used. This 
>>>table normalized by JDBC should list all roles, including default system 
>>>roles... The query is: SELECT ROLE_NAME FROM 
>>>INFORMATION_SCHEMA.ADMINISTRABLE_ROLE_AUTHORIZATIONS
>>>
>>> This view is a part of the SQL Standard. Database systems with optional 
>> features T331, “Basic roles” and F391, “Long identifiers” should also 
>> provide this view. We can add this view to H2.
>>
>>>
>>>- in order to obtain the hierarchy of roles as well as the users 
>>>assigned to roles since there is no standardized table in JDBC, I 
>>>need a table in INFORMATION_SCHEMA allowing to establish these 
>>> relations.  With 
>>>HsqlDB, fredt provided me with the 
>>>INFORMATION_SCHEMA.ROLE_AUTHORIZATION_DESCRIPTORS table which lists all 
>>> the 
>>>GRANTEE and ROLE_NAME and allows me to establish the relationships...
>>>
>>> There is no such table or view is the SQL Standard. There is a 
>> DEFINITION_SCHEMA.ROLE_AUTHORIZATION_DESCRIPTORS table, but according to 
>> the Standard, DEFINITION_SCHEMA is not accessible to applications even if 
>> it exists. Applications should use views in INFORMATION_SCHEMA based on 
>> this table, such as INFORMATION_SCHEMA.APPLICABLE_ROLES, 
>> INFORMATION_SCHEMA.ENABLED_ROLES and others, but they don't provide 
>> complete information. We can add these standard views to H2, but we 
>> shouldn't add ROLE_AUTHORIZATION_DESCRIPTORS.
>>
>> In the current H2 all available information is provided 
>> in INFORMATION_SCHEMA.USERS, INFORMATION_SCHE

Re: [h2] Management of users, roles and privileges in LibreOffice Base

2022-09-03 Thread prrvchr
Hi Evgenij Ryazanov,

I am aware of the requirements for this integration into Base. Thank you 
for answering it, it will be good for the LibreOffice / OpenOffice suites 
and will make them a little less moribund...

To get the list of users, I now use INFORMATION_SCHEMA.USERS table with the 
query: SELECT USER FROM INFORMATION_SCHEMA.USERS

To get the list of roles, I can use INFORMATION_SCHEMA.ROLES table with the 
query: SELECT ROLE_NAME FROM INFORMATION_SCHEMA.ROLES or your can create a 
new view INFORMATION_SCHEMA.ADMINISTRABLE_ROLE_AUTHORIZATIONS, as it suits 
you.

To get the hierarchy and users of roles, although I know nothing about it, 
I believe that there is no defined standard, but I need a view allowing me 
to establish the tree of roles as well as to know the roles of a user.

I have a problem with java.sql.DatabaseMetaData.getUserName(), it seems to 
me that it returns a empty or blank user with a database created during the 
first connection.

I also don't see a like DBA role allowing the administration of privileges 
and such, it would make things easier if there was one.

Thank you for your contribution.


Le samedi 3 septembre 2022 à 06:58:49 UTC+2, Evgenij Ryazanov a écrit :

> Hi!
>
> On Friday, 2 September 2022 at 23:40:02 UTC+8 prrvchr wrote:
>
>>
>>- java.sql.DatabaseMetaData.getUserName() should return the user who 
>>is logged in (current user).
>>
>> This method is implemented in H2 itself properly. You can also use 
> standard CURRENT_USER expression in SQL.
>
>
>>- In order to obtain all the users declared on the database the 
>>INFORMATION_SCHEMA.SYSTEM_USERS table is used. This table normalized 
>>by JDBC must list all the users whose current user... The query is: 
>> SELECT 
>>USER_NAME FROM INFORMATION_SCHEMA.SYSTEM_USERS
>>
>> There is no such table or view in the SQL Standard. INFORMATION_SCHEMA is 
> not related to JDBC in any way, it is covered only by the SQL Standard, 
> Part 11: Information and Definition Schemas (SQL/Schemata). H2 has own 
> non-standard table INFORMATION_SCHEMA.USERS, you need to use it instead.
>  
>
>>
>>- In order to obtain all the roles declared on the database the 
>>INFORMATION_SCHEMA.ADMINISTRABLE_ROLE_AUTHORIZATIONS table is used. This 
>>table normalized by JDBC should list all roles, including default system 
>>roles... The query is: SELECT ROLE_NAME FROM 
>>INFORMATION_SCHEMA.ADMINISTRABLE_ROLE_AUTHORIZATIONS
>>
>> This view is a part of the SQL Standard. Database systems with optional 
> features T331, “Basic roles” and F391, “Long identifiers” should also 
> provide this view. We can add this view to H2.
>
>>
>>- in order to obtain the hierarchy of roles as well as the users 
>>assigned to roles since there is no standardized table in JDBC, I 
>>need a table in INFORMATION_SCHEMA allowing to establish these relations. 
>>  With 
>>HsqlDB, fredt provided me with the 
>>INFORMATION_SCHEMA.ROLE_AUTHORIZATION_DESCRIPTORS table which lists all 
>> the 
>>GRANTEE and ROLE_NAME and allows me to establish the relationships...
>>
>> There is no such table or view is the SQL Standard. There is a 
> DEFINITION_SCHEMA.ROLE_AUTHORIZATION_DESCRIPTORS table, but according to 
> the Standard, DEFINITION_SCHEMA is not accessible to applications even if 
> it exists. Applications should use views in INFORMATION_SCHEMA based on 
> this table, such as INFORMATION_SCHEMA.APPLICABLE_ROLES, 
> INFORMATION_SCHEMA.ENABLED_ROLES and others, but they don't provide 
> complete information. We can add these standard views to H2, but we 
> shouldn't add ROLE_AUTHORIZATION_DESCRIPTORS.
>
> In the current H2 all available information is provided 
> in INFORMATION_SCHEMA.USERS, INFORMATION_SCHEMA.ROLES, and 
> INFORMATION_SCHEMA.GRANTS. These tables are non-standard and non-portable.
>
> https://h2database.com/html/systemtables.html#information_schema_users
> https://h2database.com/html/systemtables.html#information_schema_roles
> https://h2database.com/html/systemtables.html#information_schema_rights
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/c65b51c7-0ff8-40c7-b331-328867759bdcn%40googlegroups.com.


[h2] Management of users, roles and privileges in LibreOffice Base

2022-08-24 Thread prrvchr
Hi all,

I just finished the admin module 

 
allowing the management of users, roles and privileges in LibreOffice Base.
This integration could only be done with the help of fredt from hsqldb.org 
who provided me with the resources necessary for the successful completion 
of the module.

I am ready to make the effort to try to achieve the same level of 
integration of H2 in LibreOffice Base if you are willing to provide these 
necessary resources.
It only depends on you.

Thanks

Pierre

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/2601772b-7d3e-4b6e-b9bb-790a80f802bfn%40googlegroups.com.


[h2] New LibreOffice driver for H2

2022-07-05 Thread prrvchr

Hi all,

I just finished implementing H2 integration in the new driver for 
LibreOffice/OpenOffice jdbcDriverOOo 
<https://github.com/prrvchr/jdbcDriverOOo>.

This driver must allow in Base:

   - The creation, deletion, modification, copy of table.
   - The creation, deletion, modification of view.
   - Editing the contents of tables and views if they are editable.
   - Creation, deletion of users and modification of the password.
   - Creation, modification, deletion of indexes.
   - Assigning user rights to database tables and views.


If there are people who are ready to test this first version, then I'm 
interested because it saves me a lot of time (because unfortunately I'm not 
paid ;-)

Here is the download link: jdbcDriverOOo 
<https://github.com/prrvchr/jdbcDriverOOo/raw/master/source/jdbcDriverOOo/dist/jdbcDriverOOo.oxt>
 
and the documentation <https://prrvchr.github.io/jdbcDriverOOo/>.

You must have Java version 11 minimum, and I recommend LibreOffice because 
the port to OpenOffice has not yet been done.

To have access to the extended mode of the driver you must validate the 
extended mode in: *Tools -> Options -> Base drivers -> JDBC Driver* and 
chose *com.sun.star.sdbcx.Driver* in *Driver UNO Service*. A restart of 
LibreOffice is needed.

This driver is not finished, it remains to manage the Indexes, the users 
and the rights on the tables...

Thank you for your help.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/0eccfbb8-8fad-4e71-8be1-8d3ca47e0666n%40googlegroups.com.


Re: [h2] ALTER VIEW PUBLIC."View1" AS SELECT ....

2022-07-05 Thread prrvchr

CREATE OR REPLACE works like a charm...

If there are people who are ready to test this first version, then I'm 
interested because it saves me a lot of time (because unfortunately I'm not 
paid ;-)

Here is the download link: jdbcDriverOOo 
<https://github.com/prrvchr/jdbcDriverOOo/blob/master/jdbcDriverOOo.oxt> 
and the documentation <https://prrvchr.github.io/jdbcDriverOOo/>.

You must have Java version 11 minimum, and I recommend LibreOffice because 
the port to OpenOffice has not yet been done.

To have access to the extended mode of the driver you must validate the 
extended mode in: *Tools -> Options -> Base drivers -> JDBC Driver* and 
chose *com.sun.star.sdbcx.Driver* in *Driver UNO Service*. A restart of 
LibreOffice is needed.

This driver is not finished, it remains to manage the Indexes, the users 
and the rights on the tables...

Thank you for your help.





Le mardi 5 juillet 2022 à 11:58:45 UTC+2, prrvchr a écrit :

> Hi Evgenij,
>
> Thank you for answering me. I will use:
>
> CREATE OR REPLACE VIEW viewName AS ..
>
> Le mardi 5 juillet 2022 à 11:50:20 UTC+2, prrvchr a écrit :
>
>> Hi Andreas,
>>
>> The UNO API also provides an interface com.sun.star.sdbcx.XRename 
>> <https://www.openoffice.org/api/docs/common/ref/com/sun/star/sdbcx/XRename.html>
>>  
>> to change the name of a view, but apparently this interface is not 
>> implemented in Base because it is never called.
>>
>> But I don't want to rename the view but change its command, and I can't 
>> find a command in H2 to do so.
>> Please advise me the best alternative.
>>
>>
>> Le mardi 5 juillet 2022 à 11:38:52 UTC+2, and...@manticore-projects.com 
>> a écrit :
>>
>>> Greetings!
>>>
>>> On Tue, 2022-07-05 at 02:36 -0700, prrvchr wrote:
>>>
>>> What is the best alternative with H2?
>>>
>>>
>>> H2 has a really excellent documentation: 
>>> https://www.h2database.com/html/commands.html
>>>
>>> Your are looking for: 
>>> https://www.h2database.com/html/commands.html#alter_view_rename
>>>
>>> Best regards
>>> Andreas
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/8023a814-b3fd-495b-ba12-8d639bac7d18n%40googlegroups.com.


Re: [h2] ALTER VIEW PUBLIC."View1" AS SELECT ....

2022-07-05 Thread prrvchr
Hi Evgenij,

Thank you for answering me. I will use:

CREATE OR REPLACE VIEW viewName AS ..

Le mardi 5 juillet 2022 à 11:50:20 UTC+2, prrvchr a écrit :

> Hi Andreas,
>
> The UNO API also provides an interface com.sun.star.sdbcx.XRename 
> <https://www.openoffice.org/api/docs/common/ref/com/sun/star/sdbcx/XRename.html>
>  
> to change the name of a view, but apparently this interface is not 
> implemented in Base because it is never called.
>
> But I don't want to rename the view but change its command, and I can't 
> find a command in H2 to do so.
> Please advise me the best alternative.
>
>
> Le mardi 5 juillet 2022 à 11:38:52 UTC+2, and...@manticore-projects.com a 
> écrit :
>
>> Greetings!
>>
>> On Tue, 2022-07-05 at 02:36 -0700, prrvchr wrote:
>>
>> What is the best alternative with H2?
>>
>>
>> H2 has a really excellent documentation: 
>> https://www.h2database.com/html/commands.html
>>
>> Your are looking for: 
>> https://www.h2database.com/html/commands.html#alter_view_rename
>>
>> Best regards
>> Andreas
>>
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/008fd9af-6859-4063-a806-d1c9595c82fbn%40googlegroups.com.


Re: [h2] ALTER VIEW PUBLIC."View1" AS SELECT ....

2022-07-05 Thread prrvchr
Hi Andreas,

The UNO API also provides an interface com.sun.star.sdbcx.XRename 
<https://www.openoffice.org/api/docs/common/ref/com/sun/star/sdbcx/XRename.html>
 
to change the name of a view, but apparently this interface is not 
implemented in Base because it is never called.

But I don't want to rename the view but change its command, and I can't 
find a command in H2 to do so.
Please advise me the best alternative.


Le mardi 5 juillet 2022 à 11:38:52 UTC+2, and...@manticore-projects.com a 
écrit :

> Greetings!
>
> On Tue, 2022-07-05 at 02:36 -0700, prrvchr wrote:
>
> What is the best alternative with H2?
>
>
> H2 has a really excellent documentation: 
> https://www.h2database.com/html/commands.html
>
> Your are looking for: 
> https://www.h2database.com/html/commands.html#alter_view_rename
>
> Best regards
> Andreas
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/81a629f4-f62f-4f34-beba-d478f52ce688n%40googlegroups.com.


[h2] ALTER VIEW PUBLIC."View1" AS SELECT ....

2022-07-05 Thread prrvchr
Hi all,

I come back to you for help.

Base offers the ability to change the command of a View with the 
com.sun.star.sdbcx.XAlterView 

 
interface.
With HsqlDB I just have to run the command:

`ALTER VIEW ViewName AS NewCommand`

What is the best alternative with H2?

Thanks.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/2e77665b-291e-491b-9655-8c97cd8fe3ddn%40googlegroups.com.


[h2] Re: No AUTO_INCREMENT in DatabaseMetaData.getTypeInfo()

2022-07-04 Thread prrvchr

This problem has been solved and I would particularly like to thank @
*Katzyn* and @*Evgenij* for their help and their reactivity...
Le lundi 4 juillet 2022 à 12:20:17 UTC+2, prrvchr a écrit :

> Hi Evgenij,
>
> I just saw that Katzyn has already committed the correction 
> <https://github.com/h2database/h2database/pull/3568>.
> Maybe you know where I can find the corrected H2 jar archive?
>
> And maybe you can help me to finish the integration of auto increment in 
> Base?
> Apparently H2 does not support a command like:
>
> CREATE TABLE "PUBLIC"."PUBLIC"."Table1" ("ID" INTEGER NOT NULL GENERATED 
> BY DEFAULT AS IDENTITY, "Name" VARCHAR(100), PRIMARY KEY ("ID"))
>
> If so, I can create the table then the index in two separate commands:
> CREATE TABLE "PUBLIC"."PUBLIC"."Table1" ("ID" INTEGER NOT NULL GENERATED 
> BY DEFAULT AS IDENTITY, "Name" VARCHAR(100))
>
> ALTER TABLE "PUBLIC"."PUBLIC"."Table1" ADD INDEX .
>
> I don't know the second command...
> Thanks.
>
> Le lundi 4 juillet 2022 à 04:06:33 UTC+2, Evgenij Ryazanov a écrit :
>
>> Hello.
>>
>> Identity columns don't have any dedicated data types in the SQL Standard 
>> and it the most of database systems. When you declare an identity column 
>> you must specify both data type (BIGINT or INTEGER, for example) and 
>> identity clause (GENERATED BY DEFAULT AS IDENTITY etc.)
>>
>> Few database systems have special data types with implicit identity 
>> characteristics due to historic reasons. PostgreSQL has serial data types (
>> smallserial = serial2, serial = serial4, bigserial = serial8). Normally 
>> identity columns should be used in modern versions of PostgreSQL instead of 
>> these legacy types, but at least JDBC drivers have something to report 
>> here. PgJDBC reports only smallserial, serial, and bigserial data types 
>> in getTypeInfo() with TRUE in AUTO_INCREMENT column.
>>
>> H2 doesn't have special types (compatibility modes have some) and returns 
>> FALSE for all data types.
>>
>> HSQLDB doesn't have special types, but it returns TRUE for TYNYINT, 
>> SMALLINT, INTGER, BIGINT, DECIMAL and NUMERIC. These data types may be 
>> used for identity columns, but an additional clause must be specified in 
>> their definitions.
>>
>> Derby doesn't have special types, it returns TRUE for SMALLINT, INTEGER, 
>> and BIGINT, so situation is the same. It also returns NULL for LOB data 
>> types, it looks like a bug.
>>
>> It means some drivers (PgJDBC, H2) assume that TRUE in this column 
>> indicates a special data type with implicit identity characteristics, some 
>> other drivers (HSQLDB, Derby) assume that TRUE indicates a data type 
>> that may be used for an identity column with additional identity generation 
>> clauses.
>>
>> Why this deviation exists? In the SQL Standard, INFORMATION_SCHEMA is 
>> described in a separate book with more than 300 pages and we usually can 
>> say where it was implemented correctly and where it isn't correct. But JDBC 
>> metadata is only described in its own Javadoc and these descriptions are 
>> too brief and obscure. In many cases it isn't possible to determine what 
>> they exactly mean, so developers of JDBC drivers need to guess or they can 
>> try to copy behavior of some other driver.
>>
>> I think we can change our implementation to return TRUE for TINYINT, 
>> SMALLINT, INTEGER, BIGINT, and NUMERIC data types.
>>
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/01ef2f8f-44ff-4183-b8e6-1f2656cb31f7n%40googlegroups.com.


[h2] Re: No AUTO_INCREMENT in DatabaseMetaData.getTypeInfo()

2022-07-04 Thread prrvchr
Hi Evgenij,

I just saw that Katzyn has already committed the correction 
.
Maybe you know where I can find the corrected H2 jar archive?

And maybe you can help me to finish the integration of auto increment in 
Base?
Apparently H2 does not support a command like:

CREATE TABLE "PUBLIC"."PUBLIC"."Table1" ("ID" INTEGER NOT NULL GENERATED BY 
DEFAULT AS IDENTITY, "Name" VARCHAR(100), PRIMARY KEY ("ID"))

If so, I can create the table then the index in two separate commands:
CREATE TABLE "PUBLIC"."PUBLIC"."Table1" ("ID" INTEGER NOT NULL GENERATED BY 
DEFAULT AS IDENTITY, "Name" VARCHAR(100))

ALTER TABLE "PUBLIC"."PUBLIC"."Table1" ADD INDEX .

I don't know the second command...
Thanks.

Le lundi 4 juillet 2022 à 04:06:33 UTC+2, Evgenij Ryazanov a écrit :

> Hello.
>
> Identity columns don't have any dedicated data types in the SQL Standard 
> and it the most of database systems. When you declare an identity column 
> you must specify both data type (BIGINT or INTEGER, for example) and 
> identity clause (GENERATED BY DEFAULT AS IDENTITY etc.)
>
> Few database systems have special data types with implicit identity 
> characteristics due to historic reasons. PostgreSQL has serial data types (
> smallserial = serial2, serial = serial4, bigserial = serial8). Normally 
> identity columns should be used in modern versions of PostgreSQL instead of 
> these legacy types, but at least JDBC drivers have something to report 
> here. PgJDBC reports only smallserial, serial, and bigserial data types 
> in getTypeInfo() with TRUE in AUTO_INCREMENT column.
>
> H2 doesn't have special types (compatibility modes have some) and returns 
> FALSE for all data types.
>
> HSQLDB doesn't have special types, but it returns TRUE for TYNYINT, 
> SMALLINT, INTGER, BIGINT, DECIMAL and NUMERIC. These data types may be 
> used for identity columns, but an additional clause must be specified in 
> their definitions.
>
> Derby doesn't have special types, it returns TRUE for SMALLINT, INTEGER, 
> and BIGINT, so situation is the same. It also returns NULL for LOB data 
> types, it looks like a bug.
>
> It means some drivers (PgJDBC, H2) assume that TRUE in this column 
> indicates a special data type with implicit identity characteristics, some 
> other drivers (HSQLDB, Derby) assume that TRUE indicates a data type that 
> may be used for an identity column with additional identity generation 
> clauses.
>
> Why this deviation exists? In the SQL Standard, INFORMATION_SCHEMA is 
> described in a separate book with more than 300 pages and we usually can 
> say where it was implemented correctly and where it isn't correct. But JDBC 
> metadata is only described in its own Javadoc and these descriptions are 
> too brief and obscure. In many cases it isn't possible to determine what 
> they exactly mean, so developers of JDBC drivers need to guess or they can 
> try to copy behavior of some other driver.
>
> I think we can change our implementation to return TRUE for TINYINT, 
> SMALLINT, INTEGER, BIGINT, and NUMERIC data types.
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/6373be3a-7a47-4462-9de2-ec05c3c80003n%40googlegroups.com.


[h2] No AUTO_INCREMENT in DatabaseMetaData.getTypeInfo()

2022-07-03 Thread prrvchr

Hi all,

It seems that no DataType returned by DatabaseMetaData.getTypeInfo() has 
the AUTO_INCREMENT column set to true.

Normally it seems that DataType: INTEGER, BIGINT, TINYINT, SMALLINT, 
NUMERIC, DECIMAL should be autoincrement and have AUTO_INCREMENT column set 
to true.

This prevents me from being able to handle auto-increments in creating 
tables in LibreOffice Base... any workaround?



-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/ffb442ad-3c8a-4879-a74b-f99ed69e367dn%40googlegroups.com.


[h2] Re: ResultSet.cancelRowUpdates() throw Exception If no updates have been made

2022-06-24 Thread prrvchr
I opened an issue <https://github.com/h2database/h2database/issues/3559> 
because I don't have any solution to this problem...

Le jeudi 23 juin 2022 à 17:38:08 UTC+2, prrvchr a écrit :

>
> Hi,
>
> H2 seems not to follow the JDBC specs and throws an exception when calling 
> the ResultSet.cancelRowUpdates() 
> <https://docs.oracle.com/javase/7/docs/api/java/sql/ResultSet.html#cancelRowUpdates()>
>  
> method, if no updates have been made, with the following message:
>
>
>
>
>
>
>
>
> *org.h2.jdbc.JdbcSQLNonTransientException: No data is available 
> [2000-212]at 
> org.h2.message.DbException.getJdbcSQLException(DbException.java:497)
> at org.h2.message.DbException.getJdbcSQLException(DbException.java:477)
> at org.h2.message.DbException.get(DbException.java:223)at 
> org.h2.message.DbException.get(DbException.java:199)at 
> org.h2.message.DbException.get(DbException.java:188)at 
> org.h2.jdbc.JdbcResultSet.cancelRowUpdates(JdbcResultSet.java:3437)
> at 
> io.github.prrvchr.uno.sdbc.ResultSetBase.cancelRowUpdates(ResultSetBase.java:560)*
>
> This method as well as *moveToInsertRow()* is called by Base to ensure 
> the availability of interfaces and to consider the ResultSet as updatable.
>
> Thank you for your help.
>
> Tested with H2 version 2.1.212
>
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/a7f273ac-9c1a-46d4-82f4-cea9fa855dc4n%40googlegroups.com.


[h2] ResultSet.cancelRowUpdates() throw Exception If no updates have been made

2022-06-23 Thread prrvchr

Hi,

H2 seems not to follow the JDBC specs and throws an exception when calling 
the ResultSet.cancelRowUpdates() 

 
method, if no updates have been made, with the following message:








*org.h2.jdbc.JdbcSQLNonTransientException: No data is available [2000-212]  
  at 
org.h2.message.DbException.getJdbcSQLException(DbException.java:497)
at org.h2.message.DbException.getJdbcSQLException(DbException.java:477)
at org.h2.message.DbException.get(DbException.java:223)at 
org.h2.message.DbException.get(DbException.java:199)at 
org.h2.message.DbException.get(DbException.java:188)at 
org.h2.jdbc.JdbcResultSet.cancelRowUpdates(JdbcResultSet.java:3437)
at 
io.github.prrvchr.uno.sdbc.ResultSetBase.cancelRowUpdates(ResultSetBase.java:560)*

This method as well as *moveToInsertRow()* is called by Base to ensure the 
availability of interfaces and to consider the ResultSet as updatable.

Thank you for your help.

Tested with H2 version 2.1.212

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/dee1483f-9c49-4425-b867-b52fab108231n%40googlegroups.com.


Re: [h2] Re: No SYSTEM TABLE in TABLE_TYPE column returned by DatabaseMetaData.getTables()

2022-06-23 Thread prrvchr

Thanks Evgenij, I will try to do something with this request...
Le jeudi 23 juin 2022 à 12:09:07 UTC+2, Evgenij Ryazanov a écrit :

> I forgot to add TABLE_TYPE alias after CASE … END.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/d5a9da94-ce16-486c-8cc9-1311dddf34e4n%40googlegroups.com.


Re: [h2] Re: No SYSTEM TABLE in TABLE_TYPE column returned by DatabaseMetaData.getTables()

2022-06-23 Thread prrvchr
This is exactly what I wanted to avoid, but I can override the 
Databsae.getTables() method...

What would be the SQL query to obtain a resultset with SYSTEM TABLE as 
TABLE_TYPE for the table and view contained in INFORMATION_SCHEMA?

Le jeudi 23 juin 2022 à 09:58:11 UTC+2, prrvchr a écrit :

> Hi Noel,
>
> *What you can do, is to special case H2 in your JDBC driver*
>
> I already have java services 
> <https://github.com/prrvchr/jdbcDriverOOo/tree/master/source/Driver-HsqlDB/source/io/github/prrvchr/jdbcdriver/hsqldb>
>  
> specific to each driver, but unfortunately for this problem, not being able 
> to change how Base works, I can't do anything...
>
>
> Le jeudi 23 juin 2022 à 09:48:38 UTC+2, Noel Grandin a écrit :
>
>>
>>
>> On 2022/06/23 9:30 am, prrvchr wrote: 
>> > 
>> > /I don't know what do you mean by system table and why you need to 
>> distinguish them from normal tables and views./ 
>>
>> Unfortunately, we cannot change this easily because of backwards 
>> compatibility. 
>>
>> What you can do, is to special case H2 in your JDBC driver. 
>>
>> All of the H2 system tables will have METADATA in the first column of the 
>> result set, and INFORMATION_SCHEMA in the 
>> second column. 
>>
>>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/07ab04f9-4a5b-4e5f-9f0a-caca2da83609n%40googlegroups.com.


Re: [h2] Re: No SYSTEM TABLE in TABLE_TYPE column returned by DatabaseMetaData.getTables()

2022-06-23 Thread prrvchr
Hi Noel,

*What you can do, is to special case H2 in your JDBC driver*

I already have java services 
<https://github.com/prrvchr/jdbcDriverOOo/tree/master/source/Driver-HsqlDB/source/io/github/prrvchr/jdbcdriver/hsqldb>
 
specific to each driver, but unfortunately for this problem, not being able 
to change how Base works, I can't do anything...


Le jeudi 23 juin 2022 à 09:48:38 UTC+2, Noel Grandin a écrit :

>
>
> On 2022/06/23 9:30 am, prrvchr wrote:
> > 
> > /I don't know what do you mean by system table and why you need to 
> distinguish them from normal tables and views./
>
> Unfortunately, we cannot change this easily because of backwards 
> compatibility.
>
> What you can do, is to special case H2 in your JDBC driver.
>
> All of the H2 system tables will have METADATA in the first column of the 
> result set, and INFORMATION_SCHEMA in the 
> second column.
>
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/336fd720-fbeb-43f3-8c9b-f3fb364dbe47n%40googlegroups.com.


[h2] Re: No SYSTEM TABLE in TABLE_TYPE column returned by DatabaseMetaData.getTables()

2022-06-23 Thread prrvchr
Hi Evgenij,

*I don't know what do you mean by system table and why you need to 
distinguish them from normal tables and views.*

I don't know the JDBC specification, but  with all other driver: Hsqldb, 
Derby, smallSQL, all table and view in the INFORMATION_SCHEMA have SYSTEM 
TABLE as TABLE_TYPE.

I write a JDBC driver  for 
LibreOffice/OpenOffice Base and Base use DataBaseMetaData.getTables() 
method to obtain the list of Table and View and uses the 4th argument to 
filter TABLE, VIEW and SYSTEM TABLE.

But since you are not using SYSTEM TABLE as the TABLE_TYPE for the table 
and view contained in INFORMATION_SCHEMA, any filtering is impossible.



Le jeudi 23 juin 2022 à 02:32:34 UTC+2, Evgenij Ryazanov a écrit :

> Hello.
>
> JDBC doesn't have any actual requirements for returned table types, the 
> provided list is only an example.
> H2 returns table types as required by the SQL Standard for 
> INFORMATION_SCHEMA.TABLES.TABLE_TYPE column.
>
> But each JDBC driver should return its own table types from 
> DatabaseMetaData.getTableTypes() and H2 does it correctly.
>
> I don't know what do you mean by system table and why you need to 
> distinguish them from normal tables and views. The INFORMATION_SCHEMA and 
> pg_catalog (it exists only when PostgreSQL compatibility mode was 
> enabled) normally have only very special virtual tables, but they aren't 
> expected to be found in other places.
>
> You can use non-standard DB_OBJECT_SQL function, it definitely returns 
> NULL for various special tables.
>
> SELECT TABLE_SCHEMA, TABLE_NAME, DB_OBJECT_SQL('TABLE', TABLE_SCHEMA, 
> TABLE_NAME) FROM INFORMATION_SCHEMA.TABLES;
>
> https://h2database.com/html/functions.html#db_object_sql
>
> These is also non-standard INFORMATION_SCHEMA.TABLES.TABLE_CLASS column, 
> but you should understand that names of some implementations may be changed 
> at any moment, even it patch release, some implementations may appear only 
> under certain conditions and it is possible to add an own implementation of 
> a table with a custom table engine. 
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/54e487ef-504c-4d5f-89f4-bbcd38024f99n%40googlegroups.com.


[h2] No SYSTEM TABLE in TABLE_TYPE column returned by DatabaseMetaData.getTables()

2022-06-22 Thread prrvchr

Hi all,

It seems that the TABLE_TYPE returned by DatabaseMetaData.getTables() does 
not follow JDBC 

. 

H2 only lists tables as BASE TABLE or VIEW, as a result, it is difficult or 
impossible to be able to differentiate the  SYSTEM TABLE from TABLE or VIEW.

Any idea to work around this problem?

Thanks.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/e91e5ad6-eb56-4d6c-a708-aa17c9194d68n%40googlegroups.com.


[h2] Re: H2 in LibreOffice Base

2022-04-26 Thread prrvchr
Hi Evgenij Ryazanov,

Thank you for taking the time to respond.

LibreOffice/OpenOffice Base seems very limited in its compatibility with 
JDBC 3.0 and unfortunately does not know JDBC 4.X.

Here is for example a command that Base executes when creating a table with 
an autoincrement key:
CREATE TABLE "PUBLIC"."PUBLIC"."Table1" ("ID" INTEGER NOT NULL GENERATED BY 
DEFAULT AS IDENTITY, "Name" NVARCHAR(100), PRIMARY KEY  ("ID"))
It can be noted that the declaration of the keys can only be done by the 
instruction: PRIMARY KEY  ("ID", ...)
I don't think Base is able to retrieve the keys generated by the command: *rs 
= prep.getGeneratedKeys()*, but uses an *AutoRetrievingStatement* property 
with the value:* CALL IDENTITY() *

I know that LibreOffice wants to disengage from Java and won't make any 
effort to improve the integrated JDBC driver, that's why I had to write a 
new driver for my LibreOffice extensions 
 I need a cross-platform 
database (java) supporting the Temporal System-Versioned Tables (HsqlDB 
2.5x or 2.6x)
This driver gives me complete satisfaction at the level of the UNO API (use 
of the database by the smtpMailerOOo 
 extension written in Python for 
example) but it seems important to me to make the effort to make Base 
capable of supporting these databases.
I recently integrated into the driver the archives: hsqldb.jar, h2.jar, 
derby.jar and smallsql.jar in order to make debugging in Base easier and 
think that it is welcome to have access to all these databases in 
LibreOffice.
I have the possibility in my driver to modify the DatabaseMetaData and 
ResulsetMetaData in order to make Base work correctly, the problem is not 
to correct the malfunctions but to find them...
For exemple, to have H2 functional in Base I had to translate the name of 
the table types ("BASE TABLE" into "TABLE") in the DatabaseMetaData.
In fact, I'm interested in any information that can help me.



Le lundi 18 avril 2022 à 07:10:57 UTC-4, Evgenij Ryazanov a écrit :

> Hello!
>
> Recent versions of H2 fully support identity columns from the SQL Standard 
> and their retrieving functionality from the JDBC specification.
>
> What exactly doesn't work for you? How these columns are defined? How rows 
> are inserted? How exactly LibreOffice tries to read generated values with 
> your driver?
>
> For example, an application that uses own driver of H2 should execute 
> commands like these:
>
> Statement stat = connection.createStatement();
> stat.execute("CREATE TABLE TEST(ID BIGINT GENERATED BY DEFAULT AS IDENTITY 
> PRIMARY KEY, V INTEGER)");
> PreparedStatement prep = connection.prepareStatement("INSERT INTO TEST(V) 
> VALUES (?)",
> Statement.RETURN_GENERATED_KEYS);
> prep.setInt(1, 10);
> prep.executeUpdate();
> try (ResultSet rs = prep.getGeneratedKeys()) {
> rs.next();
> System.out.println(rs.getLong("ID"));
> }
>
> Actually you can run into some unrelated issue of LibreOffice that most 
> likely is not going to be fixed, because they don't really want to spend 
> time on additional database systems.
> For example, there is a problem with tables from JDBC metadata:
> https://bugs.documentfoundation.org/show_bug.cgi?id=146673
>
> I also don't understand why you need to create an alternative driver, but 
> you may have own reasons.
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/ee361b04-66a7-4ed4-8226-03eaa5c1624en%40googlegroups.com.


[h2] H2 in LibreOffice Base

2022-04-16 Thread prrvchr
Hi all,

I'm trying to write a JDBC driver  
for LibreOffice Base and I'm having trouble getting autoincrement keys 
working with H2  in Base.
I managed to make it work with Derby and HsqlDB but not with H2...
Maybe someone has some ideas for me?
Thank you.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/6955a7ca-e34f-43da-bada-71d08091986dn%40googlegroups.com.


[h2] H2 in LIbreOffice Base

2022-04-16 Thread prrvchr
Hi all,

I'm trying to write a JDBC driver  
for LibreOffice Base and I'm having trouble getting autoincrement keys working 
with H2 in Base. 
I managed to make it work with Derby and HsqlDB but not with H2...
Maybe someone has some ideas for me?
Thank.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/8c3e7b2c-fed6-4461-892e-989cc2bb8f1fn%40googlegroups.com.