Class DriverManager


  • public final class DriverManager
    extends java.lang.Object

    Service for obtaining instances of Drivers and Connection instances.

    Since:
    0.3
    Version:
    4.0
    Author:
    Michael Grove, Fernando Hernandez
    See Also:
    Driver, Connection
    • Method Detail

      • register

        public void register​(Driver theDriver)
      • getDriver

        public Driver getDriver​(java.lang.String theURL)
                         throws StardogException
        Return a Driver suitable for opening the provided database URL
        Parameters:
        theURL - the database URL
        Returns:
        a Driver which can open connections to the database at the provided URL
        Throws:
        StardogException - if no driver is found
      • getConnection

        public Connection getConnection​(java.lang.String theURL,
                                        Options theOptions)
                                 throws StardogException
        Obtain a connection to the database at the specified URL
        Parameters:
        theURL - the database URL WITHOUT any properties
        theOptions - the connection options
        Returns:
        the connection or null if no suitable driver is found.
        Throws:
        StardogException - if there is an error while obtaining the connection.