Class ConnectorManager

java.lang.Object
com.wisecoders.dbs.schema.ConnectorManager
Direct Known Subclasses:
CLIConnectorManager

public class ConnectorManager extends Object
  • Field Details

    • decimalFormat000

      public static final DecimalFormat decimalFormat000
  • Constructor Details

    • ConnectorManager

      public ConnectorManager()
  • Method Details

    • getConnectorDbIdList

      public static List<String> getConnectorDbIdList()
    • getConnectors

      public static javafx.collections.ObservableList<Connector> getConnectors()
    • getConnectors

      public static List<Connector> getConnectors(String dbId)
    • getConnectors

      public static Connector getConnectors(String dbId, String connectorAlias)
    • getByName

      public static Connector getByName(String alias)
    • createConnector

      public static Connector createConnector(String dbId)
    • createConnector

      public static Connector createConnector(String alias, String dbId, String driverClassName, String driverJarFileName, String urlTemplateName, String host, int port, String instance, String user, boolean readOnly)
      Create a connection to database, using the driver jar file name (if there are more drivers), the JDBC URL template name
      Parameters:
      alias - - a name for the connection
      dbId - the database name
      driverClassName - is the name of the class to connect to database. Open the Connection Dialog in DbSchema and you will see the class name and driverJarFileName listed there.
      driverJarFileName - is the name of the jar driver file under 'Users/CURRENT_USER/.DbSchema/RDBMS_NAME/drivers'. Use null if you have a single driver, or specify the file name if you use multiple drivers.
      urlTemplateName - is the name which shows in the Connection Dialog when choosing a connection:'Standard', 'Using Authentication'....
      host - the server host name. You should be able to ping this host ('ping hostname')'
      port - where the server runs
      instance - the name of the database or instance in the database server
      user - to connect to
      readOnly - connection
      Returns:
      a Connector class you can use for connecting to database
    • createConnector

      public static Connector createConnector(String alias, String dbId, String driverClassName, String jdbcURL, String userName, String password)
      Create a connection using the given JDBC URL. The DBMS will be the same as the project DBMS.
      Parameters:
      alias - The connection alias, can be any pseud-name.
      driverClassName - The class name of the driver, you can find it in the JDBC combo of the connection dialog.
      jdbcURL - The JDBC URL. Same can be used if you enter 'Edit Manually' in DbSchema.
      userName - The database username.
      password - The database password.
      Returns:
      The created connection.
    • createConnector

      public static Connector createConnector(String alias, String dbId, String host, int port, String driverClassName, String instance, String user)
      Create a connector with for the same Rdbms as the model. The driver is the fist found in the list of drivers.
      Parameters:
      alias - of the connector in the project connectors list
      host - of the database
      port - of the database
      driverClassName - to use
      instance - of the database
      user - in the database
      Returns:
      the connector
    • duplicateConnector

      public static Connector duplicateConnector(Connector other)
      Duplicate an existing connector
      Parameters:
      other - the new connector alias
      Returns:
      The new connector
    • refresh

      public static void refresh()
    • proposeName

      public static String proposeName(String dbId, String name)
    • saveConnectors

      public static void saveConnectors()
    • savePasswords

      public static void savePasswords()
    • createH2LocalConnector

      public static Connector createH2LocalConnector(String name, String filePath)
    • resetConnectors

      public static void resetConnectors(String dbId)