Package be.ugent.rml.access
Class RDBAccess
- java.lang.Object
-
- be.ugent.rml.access.RDBAccess
-
-
Method Summary
Modifier and Type Method Description booleanequals(Object o)StringgetContentType()This method returns the content type.DatabaseTypegetDatabaseType()This method returns the database type.Map<String,String>getDataTypes()This method returns the datatypes used for the columns in the accessed database.StringgetDSN()This method returns the DNS.InputStreamgetInputStream()This method returns an InputStream of the results of the SQL query.StringgetPassword()This method returns the password.StringgetQuery()This method returns the SQL query.StringgetUsername()This method returns the username.inthashCode()
-
-
-
Constructor Detail
-
RDBAccess
public RDBAccess(String dsn, DatabaseType databaseType, String username, String password, String query, String contentType)
This constructor takes as arguments the dsn, database, username, password, query, and content type.- Parameters:
dsn- the data source name.databaseType- the database type.username- the username of the user that executes the query.password- the password of the above user.query- the SQL query to use.contentType- the content type of the results.
-
-
Method Detail
-
getInputStream
public InputStream getInputStream() throws IOException, SQLException, ClassNotFoundException
This method returns an InputStream of the results of the SQL query.- Specified by:
getInputStreamin interfaceAccess- Returns:
- an InputStream with the results.
- Throws:
IOExceptionSQLExceptionClassNotFoundException
-
getDataTypes
public Map<String,String> getDataTypes()
This method returns the datatypes used for the columns in the accessed database.- Specified by:
getDataTypesin interfaceAccess- Returns:
- a map of column names and their datatypes.
-
getDSN
public String getDSN()
This method returns the DNS.- Returns:
- the DNS.
-
getDatabaseType
public DatabaseType getDatabaseType()
This method returns the database type.- Returns:
- the database type.
-
getUsername
public String getUsername()
This method returns the username.- Returns:
- the username.
-
getPassword
public String getPassword()
This method returns the password.- Returns:
- the password.
-
getQuery
public String getQuery()
This method returns the SQL query.- Returns:
- the SQL query.
-
getContentType
public String getContentType()
This method returns the content type.- Returns:
- the content type.
-
-