/** * This version allows us to pass in which data source to wrap internally; * useful during initialization before the connection factory is * completely configured. */ private DataSource getDataSource(StoreContext ctx, DataSource ds) { String user, pass; if (ctx == null) { // if no context, default to the global auth info, or the auth info // of the first context if none user = getConnectionUserName(); if (user == null) user = firstUser; pass = getConnectionPassword(); if (pass == null) pass = firstPass; } else { // use the context's auth info user = ctx.getConnectionUserName(); pass = ctx.getConnectionPassword(); } return DataSourceFactory.defaultsDataSource(ds, user, pass); }
/** * This version allows us to pass in which data source to wrap internally; * useful during initialization before the connection factory is * completely configured. */ private DataSource getDataSource(StoreContext ctx, DataSource ds) { String user, pass; if (ctx == null) { // if no context, default to the global auth info, or the auth info // of the first context if none user = getConnectionUserName(); if (user == null) user = firstUser; pass = getConnectionPassword(); if (pass == null) pass = firstPass; } else { // use the context's auth info user = ctx.getConnectionUserName(); pass = ctx.getConnectionPassword(); } return DataSourceFactory.defaultsDataSource(ds, user, pass); }
/** * This version allows us to pass in which data source to wrap internally; * useful during initialization before the connection factory is * completely configured. */ private DataSource getDataSource(StoreContext ctx, DataSource ds) { String user, pass; if (ctx == null) { // if no context, default to the global auth info, or the auth info // of the first context if none user = getConnectionUserName(); if (user == null) user = firstUser; pass = getConnectionPassword(); if (pass == null) pass = firstPass; } else { // use the context's auth info user = ctx.getConnectionUserName(); pass = ctx.getConnectionPassword(); } return DataSourceFactory.defaultsDataSource(ds, user, pass); }
/** * This version allows us to pass in which data source to wrap internally; * useful during initialization before the connection factory is * completely configured. */ private DataSource getDataSource(StoreContext ctx, DataSource ds) { String user, pass; if (ctx == null) { // if no context, default to the global auth info, or the auth info // of the first context if none user = getConnectionUserName(); if (user == null) user = firstUser; pass = getConnectionPassword(); if (pass == null) pass = firstPass; } else { // use the context's auth info user = ctx.getConnectionUserName(); pass = ctx.getConnectionPassword(); } return DataSourceFactory.defaultsDataSource(ds, user, pass); }
/** * This version allows us to pass in which data source to wrap internally; * useful during initialization before the connection factory is * completely configured. */ private DataSource getDataSource(StoreContext ctx, DataSource ds) { String user, pass; if (ctx == null) { // if no context, default to the global auth info, or the auth info // of the first context if none user = getConnectionUserName(); if (user == null) user = firstUser; pass = getConnectionPassword(); if (pass == null) pass = firstPass; } else { // use the context's auth info user = ctx.getConnectionUserName(); pass = ctx.getConnectionPassword(); } return DataSourceFactory.defaultsDataSource(ds, user, pass); }
public DataSource getDataSource2(StoreContext ctx) { // if there is no connection factory 2, use the primary factory DataSource ds = (DataSource) getConnectionFactory2(); if (ds == null) return getDataSource(ctx); // prefer the global connection 2 auth info if given String user = getConnection2UserName(); String pass = getConnection2Password(); if (user == null && pass == null) { // no global auth info; use the context if given, or the first // context if not if (ctx == null) { user = firstUser; pass = firstPass; } else { user = ctx.getConnectionUserName(); pass = ctx.getConnectionPassword(); } } return DataSourceFactory.defaultsDataSource(ds, user, pass); }
pass = firstPass; } else { user = ctx.getConnectionUserName(); pass = ctx.getConnectionPassword();
pass = firstPass; } else { user = ctx.getConnectionUserName(); pass = ctx.getConnectionPassword();
pass = firstPass; } else { user = ctx.getConnectionUserName(); pass = ctx.getConnectionPassword();
pass = firstPass; } else { user = ctx.getConnectionUserName(); pass = ctx.getConnectionPassword();