com.ibm.as400.access

Class JDDataSourceURL

  • java.lang.Object
    • com.ibm.as400.access.JDDataSourceURL
  • All Implemented Interfaces:
    java.io.Serializable


    public class JDDataSourceURL
    extends java.lang.Object
    implements java.io.Serializable

    A class representing a URL specifying an IBM i system data source. This is needed to connect before accessing data. The supported syntaxes for the DB2 for IBM i database URL are documented in the comments for AS400JDBCDriver.

    See Also:
    Serialized Form
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      int getPortNumber() 
      java.lang.String getSchema()
      Validate and return the schema as it was parsed from the URL.
      java.lang.String getServerName()
      Get the system name as it was parsed from the URL.
      boolean isPortSpecified()
      Was a port specified in the URL?
      boolean isValid()
      Is the URL valid for access by this JDBC driver?
      java.lang.String toString()
      Return the URL as a String.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • JDDataSourceURL

        public JDDataSourceURL(java.lang.String url)
        Constructor.
        Parameters:
        url - The URL to parse.
      • JDDataSourceURL

        public JDDataSourceURL(JDDataSourceURL originalDataSourceUrl_,
                       java.lang.String server,
                       java.lang.String port)
    >
    • Method Detail

      • getSchema

        public java.lang.String getSchema()
                                   throws java.sql.SQLException
        Validate and return the schema as it was parsed from the URL. We do validation here since the system does not do any - which results in errors happening later that are difficult to debug.
        Returns:
        URL schema, or null if it is invalid.
        Throws:
        java.sql.SQLException - If a database error occurs.
      • getServerName

        public java.lang.String getServerName()
        Get the system name as it was parsed from the URL.
        Returns:
        System name.
      • isPortSpecified

        public boolean isPortSpecified()
        Was a port specified in the URL?
        Returns:
        true if a port was specified.
      • isValid

        public boolean isValid()
        Is the URL valid for access by this JDBC driver?
        Returns:
        true if valid.
      • getPortNumber

        public int getPortNumber()
      • toString

        public java.lang.String toString()
        Return the URL as a String.
        Overrides:
        toString in class java.lang.Object
        Returns:
        The URL as a String.