Hi,
I have a problem. I am using recent H2 (via maven):
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.193</version>
</dependency>
Following simple command did work as expected:
CREATE TABLE "search_tree" (
>
> "code" BIGINT NOT NULL
>
> )
>
now it creates table and the column is not visible ... tested also from
embedded web console.
Similar command work normally:
CREATE TABLE "searchtree" (
>
> "code" BIGINT NOT NULL
>
> )
>
There is the only one difference, now I create the database with* Czech
collation*,
so after creating database, before creating tables I run command:
SET COLLATION CZECH STRENGTH SECONDARY
>
Without it everything works as before.
*BUT* following command works normally even *with* Czech collation:
CREATE TABLE "key_entries" (
>
> "code" BIGINT NOT NULL
>
> )
>
*so it depends on the table name !*
Nevertheless columns seem to exist:
command:
> SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'PUBLIC'
gives:
SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'PUBLIC';
TABLE_CATALOG ▼
<http://10.0.10.46:8082/query.do?jsessionid=4145260ed5b3443e4d605a1d813c076a#>
TABLE_SCHEMA
<http://10.0.10.46:8082/query.do?jsessionid=4145260ed5b3443e4d605a1d813c076a#>
TABLE_NAME
<http://10.0.10.46:8082/query.do?jsessionid=4145260ed5b3443e4d605a1d813c076a#>
COLUMN_NAME
<http://10.0.10.46:8082/query.do?jsessionid=4145260ed5b3443e4d605a1d813c076a#>
ORDINAL_POSITION
<http://10.0.10.46:8082/query.do?jsessionid=4145260ed5b3443e4d605a1d813c076a#>
COLUMN_DEFAULT
<http://10.0.10.46:8082/query.do?jsessionid=4145260ed5b3443e4d605a1d813c076a#>
IS_NULLABLE
<http://10.0.10.46:8082/query.do?jsessionid=4145260ed5b3443e4d605a1d813c076a#>
DATA_TYPE
<http://10.0.10.46:8082/query.do?jsessionid=4145260ed5b3443e4d605a1d813c076a#>
CHARACTER_MAXIMUM_LENGTH
<http://10.0.10.46:8082/query.do?jsessionid=4145260ed5b3443e4d605a1d813c076a#>
CHARACTER_OCTET_LENGTH
<http://10.0.10.46:8082/query.do?jsessionid=4145260ed5b3443e4d605a1d813c076a#>
NUMERIC_PRECISION
<http://10.0.10.46:8082/query.do?jsessionid=4145260ed5b3443e4d605a1d813c076a#>
NUMERIC_PRECISION_RADIX
<http://10.0.10.46:8082/query.do?jsessionid=4145260ed5b3443e4d605a1d813c076a#>
NUMERIC_SCALE
<http://10.0.10.46:8082/query.do?jsessionid=4145260ed5b3443e4d605a1d813c076a#>
CHARACTER_SET_NAME
<http://10.0.10.46:8082/query.do?jsessionid=4145260ed5b3443e4d605a1d813c076a#>
COLLATION_NAME
<http://10.0.10.46:8082/query.do?jsessionid=4145260ed5b3443e4d605a1d813c076a#>
TYPE_NAME
<http://10.0.10.46:8082/query.do?jsessionid=4145260ed5b3443e4d605a1d813c076a#>
NULLABLE
<http://10.0.10.46:8082/query.do?jsessionid=4145260ed5b3443e4d605a1d813c076a#>
IS_COMPUTED
<http://10.0.10.46:8082/query.do?jsessionid=4145260ed5b3443e4d605a1d813c076a#>
SELECTIVITY
<http://10.0.10.46:8082/query.do?jsessionid=4145260ed5b3443e4d605a1d813c076a#>
CHECK_CONSTRAINT
<http://10.0.10.46:8082/query.do?jsessionid=4145260ed5b3443e4d605a1d813c076a#>
SEQUENCE_NAME
<http://10.0.10.46:8082/query.do?jsessionid=4145260ed5b3443e4d605a1d813c076a#>
REMARKS
<http://10.0.10.46:8082/query.do?jsessionid=4145260ed5b3443e4d605a1d813c076a#>
SOURCE_DATA_TYPE
<http://10.0.10.46:8082/query.do?jsessionid=4145260ed5b3443e4d605a1d813c076a#>
IDC PUBLIC key_entries code 1 *null* NO -5 19 19 19 10 0 Unicode CZECH
BIGINT 0 FALSE 50 *null* *null*
IDC PUBLIC search_tree code 1 *null* NO -5 19 19 19 10 0 Unicode CZECH
BIGINT 0 FALSE 50 *null* *null*
Just they are not shown in web console.
My real problem is, that my java code cannot read table columns.
Following call:
ResultSet r = m.getColumns(null, null, table, null);
>
returns proper result set with normal metadata, but the result set *is
empty.*
So my code cannot parse schema and create proper sql commands.
I guess that the same reason causes that columns are not visible in
embedded web console.
Java is:
java version "1.8.0_121"
>
> Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
>
> Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
>
on recent macOS, tomorrow I'll test it on Ubuntu.
Sincerely,
Ivo Panacek
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.