Object getDBInstance() throws Exception {
          try {
               // Get classloader from ektorp lib -- should we ensure it is the right version here?
               ClassLoader loader = libraryRef.getServiceWithException().getClassLoader();
               Class<?> couchDbClientOptionsBuilderCls = loader.loadClass(COUCHDB_CLIENT_OPTIONS_BUILDER_CLS_STR);
               Object builderInstance = couchDbClientOptionsBuilderCls.newInstance();
               if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(this, tc,
                         "creating a org.ektorp.impl.StdCouchDbInstance instance with " + props.toString());
               }
               // Parse through properties in server.xml and set them to builderInstance
               for (Map.Entry<String, Object> prop : props.entrySet()) {
                    String name = prop.getKey();
                    Object value = prop.getValue();
                    if (value != null && name.indexOf('.') < 0 && COUCHDB_CLIENT_OPTIONS_TYPES.containsKey(name))
                         set(couchDbClientOptionsBuilderCls, builderInstance, name, value);
               }

               Class<?> couchDbClientCls = loader.loadClass(COUCHDB_CLIENT_CLS_STR);
               Class<?> httpClientCls = loader.loadClass("org.ektorp.http.HttpClient");
               Constructor<?> constructor = couchDbClientCls.getConstructor(httpClientCls);
               Method builderBuildMethod = couchDbClientOptionsBuilderCls.getMethod("build");
               // Invoke the build method of the builder class to create a HttpClient.
               // This HttpClient is then used as a parameter for creating the CouchDbInstance
               couchdb = constructor.newInstance(builderBuildMethod.invoke(builderInstance));
               return couchdb;
          } catch (Throwable x) {
               // rethrowing the exception allows it to be captured in FFDC and traced automatically
               x = x instanceof InvocationTargetException ? x.getCause() : x;
               if (x instanceof Exception)
                    throw (Exception) x;
               else if (x instanceof Error)
                    throw (Error) x;
               else
                    throw new RuntimeException(x);
          }
     }
Object getDBInstance ( ) throws Exception { try { ClassLoader loader = libraryRef . getServiceWithException ( ) . getClassLoader ( ) ; Class < ? > couchDbClientOptionsBuilderCls = loader . loadClass ( COUCHDB_CLIENT_OPTIONS_BUILDER_CLS_STR ) ; Object builderInstance = couchDbClientOptionsBuilderCls . newInstance ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "creating a org.ektorp.impl.StdCouchDbInstance instance with " + props . toString ( ) ) ; } for ( Map . Entry < String , Object > prop : props . entrySet ( ) ) { String name = prop . getKey ( ) ; Object value = prop . getValue ( ) ; if ( value != null && name . indexOf ( '.' ) < 0 && COUCHDB_CLIENT_OPTIONS_TYPES . containsKey ( name ) ) set ( couchDbClientOptionsBuilderCls , builderInstance , name , value ) ; } Class < ? > couchDbClientCls = loader . loadClass ( COUCHDB_CLIENT_CLS_STR ) ; Class < ? > httpClientCls = loader . loadClass ( "org.ektorp.http.HttpClient" ) ; Constructor < ? > constructor = couchDbClientCls . getConstructor ( httpClientCls ) ; Method builderBuildMethod = couchDbClientOptionsBuilderCls . getMethod ( "build" ) ; couchdb = constructor . newInstance ( builderBuildMethod . invoke ( builderInstance ) ) ; return couchdb ; } catch ( Throwable x ) { x = x instanceof InvocationTargetException ? x . getCause ( ) : x ; if ( x instanceof Exception ) throw ( Exception ) x ; else if ( x instanceof Error ) throw ( Error ) x ; else throw new RuntimeException ( x ) ; } }
Get a CouchDbInstance instance built with provided user/pass and other configuration options

@return org.ektorp.impl.StdCouchDbInstance instance
@throws Exception
if an error occurs.