Modifier and Type | Field and Description |
---|---|
protected CallableStatement |
callableStatement
CallableStatement to return source code.
|
protected Connection |
connection
Connection management
|
protected DBURI |
dburi
DBURI
|
protected String |
returnSourceCodeObjectsStatement
Procedural statement to return list of source code objects.
|
protected String |
returnSourceCodeStatement
Procedural statement to return source code.
|
protected int |
returnType
Types value representing the type returned by callableStatement
Currently only java.sql.Types.String and java.sql.Types.Clob are supported |
Constructor and Description |
---|
DBMSMetadata(Connection c)
Minimal constructor
|
DBMSMetadata(DBURI dbURI)
Define database connection and source code to retrieve.
|
DBMSMetadata(Properties properties,
DBURI dbURI)
Define database connection and source code to retrieve with database properties.
|
DBMSMetadata(String user,
String password,
DBURI dbURI)
Define database connection and source code to retrieve with explicit database username and password.
|
Modifier and Type | Method and Description |
---|---|
Connection |
getConnection()
Return JDBC Connection for direct JDBC access to the specified database.
|
Reader |
getSourceCode(SourceObject sourceObject)
Return source code text from the database.
|
Reader |
getSourceCode(String objectType,
String name,
String schema)
return source code text
|
List<SourceObject> |
getSourceObjectList()
Return all source code objects associated with any associated DBURI.
|
List<SourceObject> |
getSourceObjectList(List<String> languages,
List<String> schemas,
List<String> sourceCodeTypes,
List<String> sourceCodeNames)
Return all source code objects associated with the specified languages, schemas, source code types and source code names.
|
protected DBURI dburi
protected Connection connection
protected String returnSourceCodeObjectsStatement
protected String returnSourceCodeStatement
protected CallableStatement callableStatement
protected int returnType
Types
value representing the type returned by callableStatement
Currently only java.sql.Types.String and java.sql.Types.Clob are supportedpublic DBMSMetadata(Connection c) throws SQLException
c
- JDBC ConnectionSQLException
public DBMSMetadata(String user, String password, DBURI dbURI) throws SQLException, MalformedURLException, ClassNotFoundException
user
- Database usernamepassword
- Database passworddbURI
- DBURI
containing JDBC connection plus parameters to specify source code.SQLException
- on failing to create JDBC connectionMalformedURLException
- on attempting to connect with malformed JDBC URLClassNotFoundException
- on failing to locate the JDBC driver class.public DBMSMetadata(Properties properties, DBURI dbURI) throws SQLException, MalformedURLException, ClassNotFoundException
properties
- database settings such as database username, passworddbURI
- DBURI
containing JDBC connection plus parameters to specify source code.SQLException
- on failing to create JDBC connectionMalformedURLException
- on attempting to connect with malformed JDBC URLClassNotFoundException
- on failing to locate the JDBC driver class.public DBMSMetadata(DBURI dbURI) throws SQLException, ClassNotFoundException
This constructor is reliant on database username and password embedded in the JDBC URL
or defaulted from the DBURI
's DriverType
.
user
- Database usernamepassword
- Database passworddbURI
- DBURI
containing JDBC connection plus parameters to specify source code.SQLException
- on failing to create JDBC connectionClassNotFoundException
- on failing to locate the JDBC driver class.public Connection getConnection() throws SQLException
SQLException
public Reader getSourceCode(SourceObject sourceObject) throws SQLException
source
- objectSQLException
public Reader getSourceCode(String objectType, String name, String schema) throws SQLException
objectType
- name
- Source Code nameschema
- Owner of the codeSQLException
- on failing to retrieve the source Code textpublic List<SourceObject> getSourceObjectList()
public List<SourceObject> getSourceObjectList(List<String> languages, List<String> schemas, List<String> sourceCodeTypes, List<String> sourceCodeNames)
Each parameter may be null and the appropriate field from any related DBURI is assigned, defaulting to the normal SQL wildcard expression ("%").
languages
- Optional list of languages to search forschemas
- Optional list of schemas to search forsourceCodeTypes
- Optional list of source code types to search forsourceCodeNames
- Optional list of source code names to search forCopyright © 2002–2017 PMD. All rights reserved.