I have the same problem....
You may circumvent this by doing the following:
SchemaCrawlerOptions = new SchemaCrawlerOptions();
schemaCrawlerOptions.setRoutineTypes(Arrays.asList(RoutineType.
procedure, RoutineType.unknown)); //RoutineType.function omitted: h2 do not
support fetching functions
Database database = SchemaCrawlerUtility.getDatabase(dataSource.
getConnection(), schemaCrawlerOptions);
You might have some use of the rest of my code too:
SchemaTextExecutable schemaTextExecutable = new SchemaTextExecutable
("schema");
schemaTextExecutable.getSchemaTextOptions().setHideConstraintNames(
true);
schemaTextExecutable.getSchemaTextOptions().setHideForeignKeyNames(
true);
schemaTextExecutable.getSchemaTextOptions().setHideIndexNames(true);
schemaTextExecutable.getSchemaTextOptions().setHidePrimaryKeyNames(
true);
schemaTextExecutable.getSchemaTextOptions().setHideTriggerNames(true
);
schemaTextExecutable.getSchemaTextOptions().
setHideRoutineSpecificNames(true);
schemaTextExecutable.getSchemaTextOptions().setShowUnqualifiedNames(
true);
schemaTextExecutable.getOutputOptions().setOutputFormatValue("json"
);
StringWriter stringWriter = new StringWriter();
schemaTextExecutable.getOutputOptions().setWriter(stringWriter);
schemaTextExecutable.executeOn(database, dataSource.getConnection
());
JSONArray report = (JSONArray) JSONValue.parse(stringWriter.
getBuffer().toString());
Den torsdagen den 21:e augusti 2014 kl. 04:31:42 UTC+2 skrev knutwannheden:
>
> Hi all,
>
> I just tried to use SchemaCrawler (http://schemacrawler.sourceforge.net/)
> to browse an H2 database. When I run the tool I immediately get this
> exception:
>
> Exception in thread "main"
> schemacrawler.schemacrawler.SchemaCrawlerException: Exception retrieving
> routines: Feature not supported: "getFunctions" [50100-176]
> at schemacrawler.crawl.SchemaCrawler.crawlRoutines(SchemaCrawler.java:228)
> at schemacrawler.crawl.SchemaCrawler.crawl(SchemaCrawler.java:495)
> at
> schemacrawler.tools.executable.BaseStagedExecutable.execute(BaseStagedExecutable.java:60)
> at
> schemacrawler.tools.commandline.SchemaCrawlerCommandLine.execute(SchemaCrawlerCommandLine.java:181)
> at
> schemacrawler.tools.commandline.SchemaCrawlerMain.main(SchemaCrawlerMain.java:78)
> at
> schemacrawler.tools.commandline.SchemaCrawlerMain.main(SchemaCrawlerMain.java:39)
> at schemacrawler.Main.main(Main.java:44)
> Caused by: org.h2.jdbc.JdbcSQLException: Feature not supported:
> "getFunctions" [50100-176]
> at org.h2.message.DbException.getJdbcSQLException(DbException.java:344)
> at org.h2.message.DbException.get(DbException.java:178)
> at org.h2.message.DbException.get(DbException.java:154)
> at
> org.h2.message.DbException.getUnsupportedException(DbException.java:215)
> at org.h2.message.TraceObject.unsupported(TraceObject.java:395)
> at
> org.h2.jdbc.JdbcDatabaseMetaData.getFunctions(JdbcDatabaseMetaData.java:3107)
> at
> schemacrawler.crawl.RoutineRetriever.retrieveFunctions(RoutineRetriever.java:159)
> at
> schemacrawler.crawl.SchemaCrawler.crawlRoutines(SchemaCrawler.java:178)
> ... 6 more
>
> Is that something that would be easy to add support for?
>
> Kind regards,
>
> Knut Wannheden
>
--
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 http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.