Get stored procedures using SchemaCrawler

前端 未结 1 481
梦谈多话
梦谈多话 2021-01-27 17:30

When I try to retrieve stored procedures from an SQL Server database using the SchemaCrawler API, I get this error:

12:28:07.427 [main] INFO  schemacrawler.crawl         


        
相关标签:
1条回答
  • 2021-01-27 17:55

    Here is how to get full SchemaCrawler support for Microsoft SQL Server.

    1. Include the SchemaCrawler jar that has Microsoft SQL Server support, in your Maven project.

    <dependency> <groupId>us.fatehi</groupId> <artifactId>schemacrawler-sqlserver</artifactId> <version>14.02.02</version> </dependency>

    1. Use code similar that this below.

      final DatabaseSystemConnector dbSystemConnector = new SqlServerDatabaseConnector().getDatabaseSystemConnector();

      final DatabaseSpecificOverrideOptions databaseSpecificOverrideOptions = dbSystemConnector.getDatabaseSpecificOverrideOptionsBuilder().toOptions();

      final SchemaCrawlerOptions schemaCrawlerOptions = new SchemaCrawlerOptions(); schemaCrawlerOptions.setSchemaInfoLevel(InfoLevel.maximum.buildSchemaInfoLevel());

      final Catalog catalog = SchemaCrawlerUtility.getCatalog(getConnection(), databaseSpecificOverrideOptions, schemaCrawlerOptions);

    2. Loop over the routines, and use Routine.getDefinition() to get the definitions.

    Sualeh Fatehi, SchemaCrawler

    0 讨论(0)
提交回复
热议问题