java.lang.Object
org.odpi.openmetadata.adapters.connectors.db2luw.utilities.DB2LUWUtils

public class DB2LUWUtils extends Object
DB2LUWUtils provides simple functions to work with Db2 for Linux, UNIX and Windows database names and connection strings.
  • Constructor Details

    • DB2LUWUtils

      public DB2LUWUtils()
  • Method Details

    • getDatabaseURL

      public static String getDatabaseURL(String serverURL, String databaseName)
      Convert the connection string for one database on a Db2 for Linux, UNIX and Windows server into a connection string for a different database on the same server. Db2's JDBC URLs identify the target database through the final path segment (eg "jdbc:db2://host:port/databaseName"), so the existing database name on the URL is replaced with the requested database's name rather than appended as a connection property.
      Parameters:
      serverURL - connection string used to connect to one database on the Db2 for Linux, UNIX and Windows Server
      databaseName - name of the target database
      Returns:
      connection string