org.ametys.plugins.datainclusion.data.sql
Class SqlDataSource

java.lang.Object
  extended by org.ametys.plugins.datainclusion.data.AbstractDataSource
      extended by org.ametys.plugins.datainclusion.data.sql.SqlDataSource
All Implemented Interfaces:
DataSource

public class SqlDataSource
extends AbstractDataSource

SQL data source.


Field Summary
protected  String _driver
          The JDBC driver.
protected  String _password
          The JDBC password.
protected  Map<String,SqlQuery> _queries
          The data source SQL queries.
protected  String _url
          The JDBC connection string.
protected  String _user
          The JDBC user.
 
Fields inherited from class org.ametys.plugins.datainclusion.data.AbstractDataSource
_description, _id, _name
 
Constructor Summary
SqlDataSource()
          Constructor.
 
Method Summary
 Connection connect()
          Connect to the JDBC server.
 Map<String,String> getAdditionalValues(boolean exceptPassword)
          Get the additional datasource configuration information.
 String getDriver()
          Get the JDBC driver.
 String getPassword()
          Get the JDBC password.
 Map<String,SqlQuery> getQueries()
          Get the queries on this datasource.
 String getType()
          Get the datasource type.
 String getUrl()
          Get the JDBC url.
 String getUser()
          Get the JDBC user.
 void setDriver(String driver)
          Set the JDBC driver.
 void setPassword(String password)
          Set the JDBC password.
 void setUrl(String url)
          Set the JDBC url.
 void setUser(String user)
          Set the JDBC user.
 
Methods inherited from class org.ametys.plugins.datainclusion.data.AbstractDataSource
getDescription, getId, getName, setDescription, setId, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_driver

protected String _driver
The JDBC driver.


_url

protected String _url
The JDBC connection string.


_user

protected String _user
The JDBC user.


_password

protected String _password
The JDBC password.


_queries

protected Map<String,SqlQuery> _queries
The data source SQL queries.

Constructor Detail

SqlDataSource

public SqlDataSource()
Constructor.

Method Detail

getType

public String getType()
Description copied from interface: DataSource
Get the datasource type.

Returns:
the datasource type.

getDriver

public String getDriver()
Get the JDBC driver.

Returns:
the JDBC driver.

setDriver

public void setDriver(String driver)
Set the JDBC driver.

Parameters:
driver - the JDBC driver.

getUrl

public String getUrl()
Get the JDBC url.

Returns:
the JDBC url.

setUrl

public void setUrl(String url)
Set the JDBC url.

Parameters:
url - the JDBC url.

getUser

public String getUser()
Get the JDBC user.

Returns:
the JDBC user.

setUser

public void setUser(String user)
Set the JDBC user.

Parameters:
user - the JDBC user.

getPassword

public String getPassword()
Get the JDBC password.

Returns:
the JDBC password.

setPassword

public void setPassword(String password)
Set the JDBC password.

Parameters:
password - the JDBC password.

getAdditionalValues

public Map<String,String> getAdditionalValues(boolean exceptPassword)
Description copied from interface: DataSource
Get the additional datasource configuration information.

Parameters:
exceptPassword - true to do not return password values
Returns:
the additional datasource information as a Map of Id -> Value.

getQueries

public Map<String,SqlQuery> getQueries()
Description copied from interface: DataSource
Get the queries on this datasource.

Returns:
the the queries on this datasource as a Map.

connect

public Connection connect()
                   throws SQLException,
                          DataInclusionException
Connect to the JDBC server.

Returns:
the JDBC Connection.
Throws:
SQLException
DataInclusionException


Copyright © 2010 Anyware Services. All Rights Reserved.