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