Class DBURI
- java.lang.Object
-
- net.sourceforge.pmd.util.database.DBURI
-
public class DBURI extends Object
Provide a single parameter to specify database objects to process.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:
- characterset
- utf8
- languages
- comma-separated list of desired PMD languages
- schemas
- comma-separated list of database schemas
- sourcecodetypes
- comma-separated list of database source code types
- sourcecodenames
- comma-separated list of database source code names
- Author:
- sturton
- See Also:
URI
-
-
Method Summary
-
-
-
Constructor Detail
-
DBURI
public DBURI(String string) throws URISyntaxException, IOException
Create DBURI from a string, combining a JDBC URL and query parameters.From the JDBC URL component, infer:
- JDBC driver class
- supported languages
- default source code types
- default schemas
From the query component, define these values, overriding any defaults:
- parsing language
- source code types
- schemas
- source code
- Parameters:
string
- URL string- Throws:
URISyntaxException
IOException
-
DBURI
public DBURI(URI uri) throws URISyntaxException, IOException
Create DBURI from a URI, combining a JDBC URL and query parameters.From the JDBC URL component, infer:
- JDBC driver class
- supported languages
- default source code types
- default schemas
From the query component, define these values, overriding any defaults:
- parsing language
- source code types
- schemas
- source code
- Parameters:
uri
- A URI- Throws:
URISyntaxException
IOException
-
-
Method Detail
-
getUri
public URI getUri()
-
setUri
public void setUri(URI uri)
-
getDbType
public DBType getDbType()
-
setDbType
public void setDbType(DBType dbType)
-
getDriverClass
public String getDriverClass()
-
setDriverClass
public void setDriverClass(String driverClass)
-
getCharacterSet
public String getCharacterSet()
-
setCharacterSet
public void setCharacterSet(String characterSet)
-
getSourceCodeType
public int getSourceCodeType()
-
setSourceCodeType
public void setSourceCodeType(int sourceCodeType)
-
getSubprotocol
public String getSubprotocol()
-
setSubprotocol
public void setSubprotocol(String subprotocol)
-
getSubnamePrefix
public String getSubnamePrefix()
-
setSubnamePrefix
public void setSubnamePrefix(String subnamePrefix)
-
getURL
public String getURL()
- Returns:
- the url
-
setURL
public void setURL(String jdbcURL)
- Parameters:
jdbcURL
- the url to set
-
-