Class Engines

java.lang.Object
com.codename1.db.sql.Engines

public final class Engines extends Object

The server engines a database URL can name: their schemes, canonical names and default ports.

Nothing here opens a connection or decides which engines an application carries -- that is whichever engine classes it names (see ServerSession.Connector). This class knows every engine's URL scheme all the same, so that a URL naming an engine is recognised as one rather than opened as a SQLite file called "postgres:".

  • Field Details

  • Method Details

    • named

      public static String named(String url)

      The engine whose scheme the URL opens with, or null when it has none of them and is therefore a SQLite path.

      RFC 3986 makes a scheme case insensitive. regionMatches rather than toLowerCase: String.toLowerCase is locale sensitive and this runtime has no Locale to ask for the root one, so on a Turkish host the I of a scheme folds to a dotless i and stops matching.

    • defaultPort

      public static int defaultPort(String engine)
      The port an engine listens on when the URL gives none.
    • canonical

      public static String canonical(String name)
      The canonical name of an engine as the build property spells it, or null for a name that is none of them. "postgresql", "mariadb" and "mssql" are accepted for the engines they mean.