/** * 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); }