Class DbUtils

java.lang.Object
org.javalite.db_migrator.DbUtils

public class DbUtils extends Object
  • Method Details

    • driverClass

      public static String driverClass(String url)
      Given a jdbc url, this tries to determine the target database and returns the driver class name as a string.
      Parameters:
      url - jdbc url
      Returns:
      jdbc driver class name
    • databaseType

      public static DatabaseType databaseType(String url)
    • extractDatabaseName

      public static String extractDatabaseName(String url)
      Given a JDBC connection URL, extract only the database name.
      Parameters:
      url - a JDBC connection URL
      Returns:
      the database name
    • extractServerUrl

      public static String extractServerUrl(String url)
      Given a JDBC connection URL, generate a new connection URL to connect directly to the database server itself (ie: no database specified).
      Parameters:
      url - a JDBC connection URL
      Returns:
      a new JDBC connection URL to connect directly to the database server
    • exec

      public static int exec(String statement, Object... params)
    • closeQuietly

      public static void closeQuietly(Object toClose)
    • blank

      public static boolean blank(String str)