public static Statement createStatement(final Connection connection) throws SQLException { checkConnection(connection); return connection.createStatement(); }
public static Statement createStatement(final Connection connection) throws SQLException { checkConnection(connection); return connection.createStatement(); }
public static String getDatabaseVersion(final Connection connection) throws SQLException { checkConnection(connection); final DatabaseMetaData dbMetaData = connection.getMetaData(); final String dbProductName = dbMetaData.getDatabaseProductName(); final String dbProductVersion = dbMetaData.getDatabaseProductVersion(); return dbProductName + " " + dbProductVersion; }
public static String getDatabaseVersion(final Connection connection) throws SQLException { checkConnection(connection); final DatabaseMetaData dbMetaData = connection.getMetaData(); final String dbProductName = dbMetaData.getDatabaseProductName(); final String dbProductVersion = dbMetaData.getDatabaseProductVersion(); return dbProductName + " " + dbProductVersion; }
private static void checkConnection(final Connection connection) throws SchemaCrawlerException { try { DatabaseUtility.checkConnection(connection); } catch (final SchemaCrawlerSQLException e) { throw new SchemaCrawlerException("Bad database connection", e); } }
public DatabaseConnector lookupDatabaseConnector(final Connection connection) { try { checkConnection(connection); final String url = connection.getMetaData().getURL(); return lookupDatabaseConnectorFromUrl(url); } catch (final SQLException e) { return DatabaseConnector.UNKNOWN; } }
RetrieverConnection(final Connection connection, final SchemaRetrievalOptions schemaRetrievalOptions) throws SQLException { this.connection = checkConnection(connection); metaData = connection.getMetaData(); this.schemaRetrievalOptions = requireNonNull(schemaRetrievalOptions, "No database specific overrides provided"); LOGGER.log(Level.CONFIG, new StringFormat("%s", schemaRetrievalOptions)); tableTypes = new TableTypes(connection); LOGGER.log(Level.CONFIG, new StringFormat("Supported table types are <%s>", tableTypes)); javaSqlTypes = new JavaSqlTypes(); }
RetrieverConnection(final Connection connection, final SchemaRetrievalOptions schemaRetrievalOptions) throws SQLException { this.connection = checkConnection(connection); metaData = connection.getMetaData(); this.schemaRetrievalOptions = requireNonNull(schemaRetrievalOptions, "No database specific overrides provided"); LOGGER.log(Level.CONFIG, new StringFormat("%s", schemaRetrievalOptions)); tableTypes = new TableTypes(connection); LOGGER.log(Level.CONFIG, new StringFormat("Supported table types are <%s>", tableTypes)); javaSqlTypes = new JavaSqlTypes(); }
try checkConnection(connection); identifiers = Identifiers.identifiers().withConnection(connection) .build();
public static Statement createStatement(final Connection connection) throws SQLException { checkConnection(connection); return connection.createStatement(); }
public static Statement createStatement(final Connection connection) throws SQLException { checkConnection(connection); return connection.createStatement(); }
public static String getDatabaseVersion(final Connection connection) throws SQLException { checkConnection(connection); final DatabaseMetaData dbMetaData = connection.getMetaData(); final String dbProductName = dbMetaData.getDatabaseProductName(); final String dbProductVersion = dbMetaData.getDatabaseProductVersion(); return dbProductName + " " + dbProductVersion; }
public static String getDatabaseVersion(final Connection connection) throws SQLException { checkConnection(connection); final DatabaseMetaData dbMetaData = connection.getMetaData(); final String dbProductName = dbMetaData.getDatabaseProductName(); final String dbProductVersion = dbMetaData.getDatabaseProductVersion(); return dbProductName + " " + dbProductVersion; }
private Path createDiagram(final Connection connection, final String extension) throws Exception { checkConnection(connection); final SchemaCrawlerOptionsBuilder schemaCrawlerOptionsBuilder = SchemaCrawlerOptionsBuilder .builder().withSchemaInfoLevel(SchemaInfoLevelBuilder.standard()) .includeRoutines(new ExcludeAll()); final SchemaCrawlerOptions schemaCrawlerOptions = schemaCrawlerOptionsBuilder .toOptions(); final Path diagramFile = createTempFilePath("schemacrawler", extension); final OutputOptions outputOptions = OutputOptionsBuilder .newOutputOptions(extension, diagramFile); final SchemaCrawlerExecutable executable = new SchemaCrawlerExecutable("schema"); executable.setSchemaCrawlerOptions(schemaCrawlerOptions); executable.setOutputOptions(outputOptions); executable.setConnection(connection); executable.execute(); return diagramFile; }
public DatabaseConnector lookupDatabaseConnector(final Connection connection) { try { checkConnection(connection); final String url = connection.getMetaData().getURL(); return lookupDatabaseConnectorFromUrl(url); } catch (final SQLException e) { return DatabaseConnector.UNKNOWN; } }
private static void checkConnection(final Connection connection) throws SchemaCrawlerException { try { DatabaseUtility.checkConnection(connection); } catch (final SchemaCrawlerSQLException e) { throw new SchemaCrawlerException("Bad database connection", e); } }
public DatabaseConnector lookupDatabaseConnector(final Connection connection) { try { checkConnection(connection); final String url = connection.getMetaData().getURL(); return lookupDatabaseConnectorFromUrl(url); } catch (final SQLException e) { return DatabaseConnector.UNKNOWN; } }
private static void checkConnection(final Connection connection) throws SchemaCrawlerException { try { DatabaseUtility.checkConnection(connection); } catch (final SchemaCrawlerSQLException e) { throw new SchemaCrawlerException("Bad database connection", e); } }
RetrieverConnection(final Connection connection, final SchemaRetrievalOptions schemaRetrievalOptions) throws SQLException { this.connection = checkConnection(connection); metaData = connection.getMetaData(); this.schemaRetrievalOptions = requireNonNull(schemaRetrievalOptions, "No database specific overrides provided"); LOGGER.log(Level.CONFIG, new StringFormat("%s", schemaRetrievalOptions)); tableTypes = new TableTypes(connection); LOGGER.log(Level.CONFIG, new StringFormat("Supported table types are <%s>", tableTypes)); javaSqlTypes = new JavaSqlTypes(); }
RetrieverConnection(final Connection connection, final SchemaRetrievalOptions schemaRetrievalOptions) throws SQLException { this.connection = checkConnection(connection); metaData = connection.getMetaData(); this.schemaRetrievalOptions = requireNonNull(schemaRetrievalOptions, "No database specific overrides provided"); LOGGER.log(Level.CONFIG, new StringFormat("%s", schemaRetrievalOptions)); tableTypes = new TableTypes(connection); LOGGER.log(Level.CONFIG, new StringFormat("Supported table types are <%s>", tableTypes)); javaSqlTypes = new JavaSqlTypes(); }