Class ResourceSQLSource

    • Constructor Detail

      • ResourceSQLSource

        public ResourceSQLSource​(URL location,
                                 String encoding)
        Constructs a new SQL source for a resource at the specified location, which uses the specified encoding.
        Parameters:
        location - location of the resource; this URL may use the classpath: scheme to specify a resource relative to the root of the classpath which will be accessing using the thread context class loader
        encoding - character set name
        Throws:
        SQLResourceNotFoundException - if the specified resource is not found
        SQLInputException - if an I/O errors when accessing the resource
      • ResourceSQLSource

        public ResourceSQLSource​(URL location,
                                 String encoding,
                                 Scanner scanner)
        Constructs a new SQL source for a resource at the specified location, which uses the specified encoding.
        Parameters:
        location - location of the resource; this URL may use the classpath: scheme to specify a resource relative to the root of the classpath which will be accessing using the thread context class loader
        encoding - character set name
        scanner - scanner to use for SQL dialect
        Throws:
        SQLResourceNotFoundException - if the specified resource is not found
        SQLInputException - if an I/O errors when accessing the resource
    • Method Detail

      • with

        public static ResourceSQLSource with​(String name,
                                             Class<?> relativeToClass)
        Creates a new SQL source for a resource in the same package as the given class, which uses the default encoding.
        Parameters:
        name - name of the resource
        relativeToClass - class that provides the package location of the resource
        Returns:
        SQL source
        Throws:
        SQLResourceNotFoundException - if the specified resource is not found
        SQLInputException - if an I/O errors when accessing the resource
      • with

        public static ResourceSQLSource with​(String name,
                                             Class<?> relativeToClass,
                                             Scanner scanner)
        Creates a new SQL source for a resource in the same package as the given class, which uses the default encoding.
        Parameters:
        name - name of the resource
        relativeToClass - class that provides the package location of the resource
        scanner - scanner to use for SQL dialect
        Returns:
        SQL source
        Throws:
        SQLResourceNotFoundException - if the specified resource is not found
        SQLInputException - if an I/O errors when accessing the resource
      • with

        public static ResourceSQLSource with​(String name,
                                             Class<?> relativeToClass,
                                             String encoding)
        Creates a new SQL source for a resource in the same package as the given class which uses the specified encoding.
        Parameters:
        name - name of the resource
        relativeToClass - class that provides the package location of the resource
        encoding - character set name
        Returns:
        SQL source
        Throws:
        SQLResourceNotFoundException - if the specified resource is not found
        SQLInputException - if an I/O errors when accessing the resource
      • with

        public static ResourceSQLSource with​(String name,
                                             Class<?> relativeToClass,
                                             String encoding,
                                             Scanner scanner)
        Creates a new SQL source for a resource in the same package as the given class which uses the specified encoding.
        Parameters:
        name - name of the resource
        relativeToClass - class that provides the package location of the resource
        encoding - character set name
        scanner - scanner to use for the SQL dialect
        Returns:
        SQL source
        Throws:
        SQLResourceNotFoundException - if the specified resource is not found
        SQLInputException - if an I/O errors when accessing the resource
      • with

        public static ResourceSQLSource with​(String name,
                                             ClassLoader classLoader)
        Creates a new SQL source for a resource relative to the root of the given class loader, which uses the default encoding.
        Parameters:
        name - name of the resource
        classLoader - class loader that will be used to access the resource
        Returns:
        SQL source
        Throws:
        SQLResourceNotFoundException - if the specified resource is not found
        SQLInputException - if an I/O errors when accessing the resource
      • with

        public static ResourceSQLSource with​(String name,
                                             ClassLoader classLoader,
                                             Scanner scanner)
        Creates a new SQL source for a resource relative to the root of the given class loader, which uses the default encoding.
        Parameters:
        name - name of the resource
        classLoader - class loader that will be used to access the resource
        scanner - scanner to use for the SQL dialect
        Returns:
        SQL source
        Throws:
        SQLResourceNotFoundException - if the specified resource is not found
        SQLInputException - if an I/O errors when accessing the resource
      • with

        public static ResourceSQLSource with​(String name,
                                             ClassLoader classLoader,
                                             String encoding)
        Creates a new SQL source for a resource relative to the root of the given class loader, which uses the specified encoding.
        Parameters:
        name - name of the resource
        classLoader - class loader that will be used to access the resource
        encoding - character set name
        Returns:
        SQL source
        Throws:
        SQLResourceNotFoundException - if the specified resource is not found
        SQLInputException - if an I/O errors when accessing the resource
      • with

        public static ResourceSQLSource with​(String name,
                                             ClassLoader classLoader,
                                             String encoding,
                                             Scanner scanner)
        Creates a new SQL source for a resource relative to the root of the given class loader, which uses the specified encoding.
        Parameters:
        name - name of the resource
        classLoader - class loader that will be used to access the resource
        encoding - character set name
        scanner - scanner to use for the SQL dialect
        Returns:
        SQL source
        Throws:
        SQLResourceNotFoundException - if the specified resource is not found
        SQLInputException - if an I/O errors when accessing the resource
      • with

        public static ResourceSQLSource with​(String name,
                                             ResourceSQLSource.ResourceAccessor accessor,
                                             String encoding)
        Creates a new SQL source for a resource that will be obtained from the given resource accessor and which uses the specified encoding.
        Parameters:
        name - name of the resource
        accessor - accessor that will be used to obtain a URL for the resource
        encoding - character set name
        Returns:
        SQL source
        Throws:
        SQLResourceNotFoundException - if the specified resource is not found
        SQLInputException - if an I/O errors when accessing the resource
      • with

        public static ResourceSQLSource with​(String name,
                                             ResourceSQLSource.ResourceAccessor accessor,
                                             String encoding,
                                             Scanner scanner)
        Creates a new SQL source for a resource that will be obtained from the given resource accessor and which uses the specified encoding.
        Parameters:
        name - name of the resource
        accessor - accessor that will be used to obtain a URL for the resource
        encoding - character set name
        scanner - scanner to use for SQL dialect
        Returns:
        SQL source
        Throws:
        SQLResourceNotFoundException - if the specified resource is not found
        SQLInputException - if an I/O errors when accessing the resource
      • with

        public static ResourceSQLSource with​(String location)
        Creates a new SQL source for a resource relative to the root of the classpath, which uses the default encoding.

        The resource will be located using the thread context class loader.

        Parameters:
        location - URL for the resource; may use the classpath: scheme to specify a resource relative to the root of the classpath (which will be accessed using the thread context class loader)
        Returns:
        SQL source
        Throws:
        SQLResourceNotFoundException - if the specified resource is not found
        SQLInputException - if an I/O errors when accessing the resource
      • with

        public static ResourceSQLSource with​(String location,
                                             Scanner scanner)
        Creates a new SQL source for a resource relative to the root of the classpath, which uses the default encoding.

        The resource will be located using the thread context class loader.

        Parameters:
        location - URL for the resource; may use the classpath: scheme to specify a resource relative to the root of the classpath (which will be accessed using the thread context class loader)
        scanner - scanner to use for SQL dialect
        Returns:
        SQL source
        Throws:
        SQLResourceNotFoundException - if the specified resource is not found
        SQLInputException - if an I/O errors when accessing the resource
      • with

        public static ResourceSQLSource with​(String location,
                                             String encoding)
        Creates a new SQL source for a resource relative to the root of the classpath, which uses the specified encoding.

        The resource will be located using the thread context class loader.

        Parameters:
        location - URL for the resource; may use the classpath: scheme to specify a resource relative to the root of the classpath (which will be accessed using the thread context class loader)
        encoding - character set name
        Returns:
        SQL source
        Throws:
        SQLResourceNotFoundException - if the specified resource is not found
        SQLInputException - if an I/O errors when accessing the resource
      • with

        public static ResourceSQLSource with​(String location,
                                             String encoding,
                                             Scanner scanner)
        Creates a new SQL source for a resource relative to the root of the classpath, which uses the specified encoding.

        The resource will be located using the thread context class loader.

        Parameters:
        location - URL for the resource; may use the classpath: scheme to specify a resource relative to the root of the classpath (which will be accessed using the thread context class loader)
        encoding - character set name
        scanner - scanner to use for SQL dialect
        Returns:
        SQL source
        Throws:
        SQLResourceNotFoundException - if the specified resource is not found
        SQLInputException - if an I/O errors when accessing the resource
      • with

        public static ResourceSQLSource with​(URI location)
        Creates a new SQL source for a resource at the specified location, which uses the specified encoding.
        Parameters:
        location - location of the resource; this URL may use the classpath: scheme to specify a resource relative to the root of the classpath (which will be accessed using the thread context class loader)
        Returns:
        SQL source
        Throws:
        SQLResourceNotFoundException - if the specified resource is not found
        SQLInputException - if an I/O errors when accessing the resource
      • with

        public static ResourceSQLSource with​(URI location,
                                             Scanner scanner)
        Creates a new SQL source for a resource at the specified location, which uses the specified encoding.
        Parameters:
        location - location of the resource; this URL may use the classpath: scheme to specify a resource relative to the root of the classpath (which will be accessed using the thread context class loader)
        scanner - scanner to use for SQL dialect
        Returns:
        SQL source
        Throws:
        SQLResourceNotFoundException - if the specified resource is not found
        SQLInputException - if an I/O errors when accessing the resource
      • with

        public static ResourceSQLSource with​(URI location,
                                             String encoding)
        Creates a new SQL source for a resource at the specified location, which uses the specified encoding.
        Parameters:
        location - location of the resource; this URL may use the classpath: scheme to specify a resource relative to the root of the classpath (which will be accessed using the thread context class loader)
        encoding - character set name
        Returns:
        SQL source
        Throws:
        SQLResourceNotFoundException - if the specified resource is not found
        SQLInputException - if an I/O errors when accessing the resource
      • with

        public static ResourceSQLSource with​(URI location,
                                             String encoding,
                                             Scanner scanner)
        Creates a new SQL source for a resource at the specified location, which uses the specified encoding.
        Parameters:
        location - location of the resource; this URL may use the classpath: scheme to specify a resource relative to the root of the classpath (which will be accessed using the thread context class loader)
        encoding - character set name
        scanner - scanner to use for SQL dialect
        Returns:
        SQL source
        Throws:
        SQLResourceNotFoundException - if the specified resource is not found
        SQLInputException - if an I/O errors when accessing the resource
      • with

        public static ResourceSQLSource with​(URL location)
        Creates a new SQL source for a resource at the specified location, which uses the specified encoding.
        Parameters:
        location - location of the resource; this URL may use the classpath: scheme to specify a resource relative to the root of the classpath which will be accessing using the thread context class loader
        Returns:
        SQL source
        Throws:
        SQLResourceNotFoundException - if the specified resource is not found
        SQLInputException - if an I/O errors when accessing the resource
      • with

        public static ResourceSQLSource with​(URL location,
                                             Scanner scanner)
        Creates a new SQL source for a resource at the specified location, which uses the specified encoding.
        Parameters:
        location - location of the resource; this URL may use the classpath: scheme to specify a resource relative to the root of the classpath which will be accessing using the thread context class loader
        scanner - scanner to use for SQL dialect
        Returns:
        SQL source
        Throws:
        SQLResourceNotFoundException - if the specified resource is not found
        SQLInputException - if an I/O errors when accessing the resource
      • with

        public static ResourceSQLSource with​(URL location,
                                             String encoding)
        Creates a new SQL source for a resource at the specified location, which uses the specified encoding.
        Parameters:
        location - location of the resource; this URL may use the classpath: scheme to specify a resource relative to the root of the classpath which will be accessing using the thread context class loader
        encoding - character set name
        Returns:
        SQL source
        Throws:
        SQLResourceNotFoundException - if the specified resource is not found
        SQLInputException - if an I/O errors when accessing the resource
      • with

        public static ResourceSQLSource with​(URL location,
                                             String encoding,
                                             Scanner scanner)
        Creates a new SQL source for a resource at the specified location, which uses the specified encoding.
        Parameters:
        location - location of the resource; this URL may use the classpath: scheme to specify a resource relative to the root of the classpath which will be accessing using the thread context class loader
        encoding - character set name
        scanner - scanner to use for SQL dialect
        Returns:
        SQL source
        Throws:
        SQLResourceNotFoundException - if the specified resource is not found
        SQLInputException - if an I/O errors when accessing the resource