public class DBURI extends Object
Wrap JDBC settings for use by PMD: optional parameters specify the source code to
be passed to PMD, or are inherited from the associated DBType
.
A DBURI is a faux-URI: it does not have a formal specification and comprises a JDBC(-ish) URL and an optional query, e.g. jdbc : subprotocol [ : subname ] : connection details [ query ]
.
The subprotocol and optional subname parts should be a valid DBType
JDBC(-ish) URL jdbc:oracle:thin:username/password@//192.168.100.21:1521/ORCL
JDBC(-ish) URL jdbc:thin:username/password@//192.168.100.21:1521/ORCL
The query includes one or more of these:-
http://docs.oracle.com/javase/7/docs/api/java/net/URI.html
Constructor and Description |
---|
DBURI(String string)
Create DBURI from a string, combining a JDBC URL and query parameters.
|
DBURI(String scheme,
String userInfo,
String host,
int port,
String path,
String query,
String fragment)
Create a DBURI from standard individual
URI components. |
Modifier and Type | Method and Description |
---|---|
String |
getCharacterSet() |
DBType |
getDbType() |
String |
getDriverClass() |
List<String> |
getLanguagesList() |
Map<String,String> |
getParameters() |
List<String> |
getSchemasList() |
List<String> |
getSourceCodeNamesList() |
int |
getSourceCodeType() |
List<String> |
getSourceCodeTypesList() |
String |
getSubnamePrefix() |
String |
getSubprotocol() |
URI |
getUri() |
String |
getURL() |
void |
setCharacterSet(String characterSet) |
void |
setDbType(DBType dbType) |
void |
setDriverClass(String driverClass) |
void |
setLanguagesList(List<String> languagesList) |
void |
setParameters(Map<String,String> parameters) |
void |
setSchemasList(List<String> schemasList) |
void |
setSourceCodeNamesList(List<String> sourceCodeNamesList) |
void |
setSourceCodeType(int sourceCodeType) |
void |
setSourceCodeTypesList(List<String> sourceCodeTypesList) |
void |
setSubnamePrefix(String subnamePrefix) |
void |
setSubprotocol(String subprotocol) |
void |
setUri(URI uri) |
void |
setURL(String jdbcURL) |
String |
toString() |
public DBURI(String string) throws URISyntaxException
From the JDBC URL component, infer:-
From the query component, define these values, overriding any defaults:-
string
- URL stringURISyntaxException
Exception
public DBURI(String scheme, String userInfo, String host, int port, String path, String query, String fragment) throws URISyntaxException
URI
components.
From the JDBC URL components, infer:-
From the query component, define these values, overriding any defaults:-
scheme
- userInfo
- host
- port
- path
- query
- fragment
- URISyntaxException
public URI getUri()
public void setUri(URI uri)
public DBType getDbType()
public void setDbType(DBType dbType)
public String getDriverClass()
public void setDriverClass(String driverClass)
public String getCharacterSet()
public void setCharacterSet(String characterSet)
public int getSourceCodeType()
public void setSourceCodeType(int sourceCodeType)
public String getSubprotocol()
public void setSubprotocol(String subprotocol)
public String getSubnamePrefix()
public void setSubnamePrefix(String subnamePrefix)
public String getURL()
public void setURL(String jdbcURL)
url
- the url to setCopyright © 2002-2017 PMD. All Rights Reserved.