Package org.openxava.util
Interface IConnectionProvider
- All Known Implementing Classes:
DataSourceConnectionProvider
public interface IConnectionProvider
Provides JDBC connections.
- Author:
- Javier Paniza
-
Method Summary
Modifier and TypeMethodDescriptionReturns a JDBC connection by default.getConnection(String dataSourceName) Returns a JDBC connection from a identifier.voidsetDefaultDataSource(String dataSourceName) Sets the datasource name used when usinggetConnection().voidsetPassword(String password) Sets password used to create connection.voidSets the user used to craete the connection.
-
Method Details
-
getConnection
Returns a JDBC connection by default.- Throws:
SQLException- If there are problem obtaining the connetion
-
getConnection
Returns a JDBC connection from a identifier.- Parameters:
dataSourceName- Name of data source from what I obtain the connection- Throws:
SQLException- If there are problem obtaining the connetion
-
setPassword
Sets password used to create connection.* Must to call to
setUser(java.lang.String)too. Although set user and password is not mandatory. -
setDefaultDataSource
Sets the datasource name used when usinggetConnection(). -
setUser
Sets the user used to craete the connection.It is not mandatory to call this method.
-