/** * Create an instance of {@link Settings } * */ public Settings createSettings() { return new Settings(); }
/** * Create an instance of {@link Settings } * */ public Settings createSettings() { return new Settings(); }
SQLDialect sqlDialect = SQLDialect.valueOf(dataSourceConfig.getSqlDialect()); DataSource dataSource = dataSourceConfig.createDataSource(); Settings settings = new Settings(); settings.setRenderNameStyle(RenderNameStyle.AS_IS); final JdbcKeyValueService kvs = new JdbcKeyValueService(
protected Settings getSettings() { return new Settings().withRenderNameStyle( RenderNameStyle.QUOTED ); }
@Bean @Primary public Settings jooqSettings() { Settings ret = new Settings(); ret.withRenderSchema(false); ret.setRenderFormatted(true); ret.setRenderNameStyle(RenderNameStyle.AS_IS); return ret; }
@Bean SpanStore spanStore() { SpanStore result; if (datasource != null && server.getStore().getType() == Type.mysql) { result = new JDBCSpanStore(datasource, new Settings().withRenderSchema(false), listener); } else { result = new InMemorySpanStore(); } return result; }
public WpDataSource(DataSource dataSource) throws DaoException { this.settings = new Settings(); this.dataSource = dataSource; Connection conn = null; try { conn = dataSource.getConnection(); this.dialect = JooqUtils.dialect(conn); } catch (SQLException e) { throw new DaoException("SQL Dao Failed. Check if the table exists / if the desired information has been parsed and stored in the database\n" + e.toString()); } finally { closeQuietly(conn); } // Postgres uses a lowercase "public" main schema if (this.dialect == SQLDialect.POSTGRES) { settings.setRenderNameStyle(RenderNameStyle.LOWER); } }
public PluginDao(final DataSource dataSource, final SQLDialect dialect) throws SQLException { this.dataSource = dataSource; this.dialect = dialect; switch (dialect) { case H2: final String schema; Connection connection = null; try { connection = dataSource.getConnection(); schema = connection.getSchema(); } finally { if (connection != null) { connection.close(); } } final MappedSchema mappedSchema = new MappedSchema().withInput(DEFAULT_SCHEMA_NAME) // As defined by the jOOQ codegen .withOutput(schema); final RenderMapping renderMapping = new RenderMapping().withSchemata(mappedSchema); this.settings = new Settings().withRenderMapping(renderMapping) .withRenderNameStyle(RenderNameStyle.UPPER); break; default: // For MySQL, schema doesn't matter. // For PostgreSQL, assume schema is part of the JDBC url this.settings = new Settings().withRenderSchema(false); break; } }
@Override protected Configuration getJooqConfiguration(ConnectionProvider cp) { return new DefaultConfiguration() .set(cp) .set(SQLDialect.MYSQL) .set(new Settings() .withRenderNameStyle(RenderNameStyle.QUOTED) ); }
private void reloadContexts() throws IOException { SQLDialect dialect = SQLDialect.valueOf(this.conf.getString("sqlDialect")); BasicDataSource ds = new BasicDataSource(); ds.setUrl(new ObjectMapper() .readValue(conf.getJSONArray("address").toString(), List.class).get(0).toString()); ds.setDriverClassName(conf.getString("driver")); String user = conf.optString("user"); String password = conf.optString("password"); if (!user.isEmpty()) ds.setUsername(user); if (!password.isEmpty()) ds.setPassword(password); Settings settings = new Settings(); settings.setRenderNameStyle(RenderNameStyle.AS_IS); Configuration conf = new DefaultConfiguration().set(ds).set(dialect) .set(settings) .set(new DefaultExecuteListenerProvider(new TimingExecuterListener())); this.context = DSL.using(conf); }
@Override protected Configuration getJooqConfiguration(ConnectionProvider cp) { return new DefaultConfiguration() .set(cp) .set(SQLDialect.POSTGRES) .set(new Settings() .withRenderNameStyle(RenderNameStyle.QUOTED) ); }
@Override protected Configuration getJooqConfiguration(ConnectionProvider cp) { return new DefaultConfiguration() .set(cp) .set(SQLDialect.POSTGRES) .set(new Settings() .withRenderNameStyle(RenderNameStyle.QUOTED) ); }
@Override public String version(CatalogDefinition catalog) { return "" + new DefaultConfiguration() .set(connection) .set(new Settings().withStatementType(STATIC_STATEMENT)) .dsl() .fetchValue( // [#2906] TODO Plain SQL statements do not yet support named parameters sql.replace(":catalog_name", "?"), param("catalog_name", catalog.getInputName()) ); } }
@Bean io.cattle.platform.db.jooq.config.Configuration LockingJooqConfiguration(DataSourceConnectionProvider dscp) { Settings settings = new Settings(); settings.setExecuteWithOptimisticLocking(true); LoggerListener logger = new LoggerListener(); logger.setMaxLength(1000); io.cattle.platform.db.jooq.config.Configuration config = new io.cattle.platform.db.jooq.config.Configuration(); config.setName("cattle"); config.setConnectionProvider(dscp); config.setListeners(Arrays.asList( logger, new StopWatchListener())); config.setSettings(settings); return config; }
Settings settings = new Settings();
@Override public String version(SchemaDefinition schema) { return "" + new DefaultConfiguration() .set(connection) .set(new Settings().withStatementType(STATIC_STATEMENT)) .dsl() .fetchValue( // [#2906] TODO Plain SQL statements do not yet support named parameters sql.replace(":schema_name", "?"), param("schema_name", schema.getInputName()) ); } }
private static Configuration createJooqConfiguration(DataSource ds) { Settings settings = new Settings(); settings.setRenderSchema(false); settings.setRenderCatalog(false); settings.setRenderNameStyle(RenderNameStyle.AS_IS); return new DefaultConfiguration() .set(settings) .set(ds) .set(SQLDialect.POSTGRES); } }
Settings jooqSettings = new Settings(); if (config.getSQLDialect().equals(SQLDialect.H2)) {