public class ResourceSQLSource extends ReaderSQLSource
SQLSource that reads SQL statements from a resource that can be
located using a URL.| Modifier and Type | Class and Description |
|---|---|
static interface |
ResourceSQLSource.ResourceAccessor
An accessor for a resource.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_ENCODING |
| Constructor and Description |
|---|
ResourceSQLSource(URL location,
String encoding)
Constructs a new SQL source for a resource at the specified location,
which uses the specified encoding.
|
| Modifier and Type | Method and Description |
|---|---|
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. |
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. |
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.
|
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. |
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.
|
static ResourceSQLSource |
with(String name,
ResourceSQLSource.ResourceAccessor accessor)
Creates a new SQL source for a resource that will be obtained from the
given resource accessor and which uses the
default encoding. |
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
default encoding. |
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.
|
static ResourceSQLSource |
with(URI location)
Creates a new SQL source for a resource at the specified location,
which uses the specified encoding.
|
static ResourceSQLSource |
with(URI location,
String encoding)
Creates a new SQL source for a resource at the specified location,
which uses the specified encoding.
|
static ResourceSQLSource |
with(URL location)
Creates a new SQL source for a resource at the specified location,
which uses the specified encoding.
|
static ResourceSQLSource |
with(URL location,
String encoding)
Creates a new SQL source for a resource at the specified location,
which uses the specified encoding.
|
close, nextpublic static final String DEFAULT_ENCODING
public ResourceSQLSource(URL location, String encoding)
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 loaderencoding - character set nameSQLResourceNotFoundException - if the specified resource is not foundSQLInputException - if an I/O errors when accessing the resourcepublic static ResourceSQLSource with(String name, Class<?> relativeToClass)
default encoding.name - name of the resourcerelativeToClass - class that provides the package location of the
resourceSQLResourceNotFoundException - if the specified resource is not foundSQLInputException - if an I/O errors when accessing the resourcepublic static ResourceSQLSource with(String name, Class<?> relativeToClass, String encoding)
name - name of the resourcerelativeToClass - class that provides the package location of the
resourceencoding - character set nameSQLResourceNotFoundException - if the specified resource is not foundSQLInputException - if an I/O errors when accessing the resourcepublic static ResourceSQLSource with(String name, ClassLoader classLoader)
default encoding.name - name of the resourceclassLoader - class loader that will be used to access the resourceSQLResourceNotFoundException - if the specified resource is not foundSQLInputException - if an I/O errors when accessing the resourcepublic static ResourceSQLSource with(String name, ClassLoader classLoader, String encoding)
name - name of the resourceclassLoader - class loader that will be used to access the resourceencoding - character set nameSQLResourceNotFoundException - if the specified resource is not foundSQLInputException - if an I/O errors when accessing the resourcepublic static ResourceSQLSource with(String name, ResourceSQLSource.ResourceAccessor accessor)
default encoding.name - name of the resourceaccessor - accessor that will be used to obtain a URL for the resourceSQLResourceNotFoundException - if the specified resource is not foundSQLInputException - if an I/O errors when accessing the resourcepublic static ResourceSQLSource with(String name, ResourceSQLSource.ResourceAccessor accessor, String encoding)
default encoding.name - name of the resourceaccessor - accessor that will be used to obtain a URL for the resourceencoding - character set nameSQLResourceNotFoundException - if the specified resource is not foundSQLInputException - if an I/O errors when accessing the resourcepublic static ResourceSQLSource with(String location)
default encoding.
The resource will be located using the thread context class loader.
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)SQLResourceNotFoundException - if the specified resource is not foundSQLInputException - if an I/O errors when accessing the resourcepublic static ResourceSQLSource with(String location, String encoding)
The resource will be located using the thread context class loader.
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 nameSQLResourceNotFoundException - if the specified resource is not foundSQLInputException - if an I/O errors when accessing the resourcepublic static ResourceSQLSource with(URI location)
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)SQLResourceNotFoundException - if the specified resource is not foundSQLInputException - if an I/O errors when accessing the resourcepublic static ResourceSQLSource with(URI location, String encoding)
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 nameSQLResourceNotFoundException - if the specified resource is not foundSQLInputException - if an I/O errors when accessing the resourcepublic static ResourceSQLSource with(URL location)
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 loaderSQLResourceNotFoundException - if the specified resource is not foundSQLInputException - if an I/O errors when accessing the resourcepublic static ResourceSQLSource with(URL location, String encoding)
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 loaderencoding - character set nameSQLResourceNotFoundException - if the specified resource is not foundSQLInputException - if an I/O errors when accessing the resourceCopyright © 2014–2015 Carl Harris, Jr. All rights reserved.