Class SQLPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class SQLPanel extends JPanel
A component for eliciting a JDBC access type URL string from the user.
Author:
Mark Taylor (Starlink)
See Also:
  • Constructor Details

    • SQLPanel

      public SQLPanel(String refString, boolean refArea)
      Constructs an SQLPanel using a given annotation for the 'ref' part of the URL (the part after the '#' character).
      Parameters:
      refString - the string used for annotating
      refArea - true to use a multi-line text area for the ref field, false for a one-line field
  • Method Details

    • useAuthenticator

      public void useAuthenticator(JDBCAuthenticator auth)
      Initialises this dialog's fields in accordance with a given JDBCAuthenticator object. In general, this will call JDBCAuthenticator.authenticate() and fill the user and password fields with the result. However, if auth is a TextModelsAuthenticator, it will actually use its models in the user and password fields.
      Parameters:
      auth - authenticator object to configure from
    • getConnector

      public Connector getConnector()
      Returns a Connector object which will make connections based on the information entered in this dialog. Note the connections will use the information current at the time this method is called, rather than reflecting subsequent changes in this object's state when the connector's getConnection method is invoked.
      Returns:
      object which gets JDBC connections
    • getBaseURL

      public String getBaseURL()
      Returns the basic URL which the user has specified by filling in the boxes. This does not include the 'ref' part.
      Returns:
      the basic URL entered by the user as used for getting an SQL connection
    • getRef

      public String getRef()
      Returns the 'ref' part of the URL, if a ref string was specified in the constructor. Otherwise null.
      Returns:
      any ref string entered by the user
    • getFullURL

      public String getFullURL()
      Returns the full URL specified by the user in this box (including the 'ref' part if there is one).
      Returns:
      full URL-like string
    • isAvailable

      public boolean isAvailable()
    • getStack

      protected LabelledComponentStack getStack()
      Returns the container for query components.
      Returns:
      query component stack
    • isSqlAvailable

      public static boolean isSqlAvailable()
      Indicates whether JDBC is set up so that it might work.
      Returns:
      true iff any JDBC drivers are installed