Package com.basiscomponents.bc
Class SqlQueryBC
- java.lang.Object
-
- com.basiscomponents.bc.SqlQueryBC
-
public class SqlQueryBC extends Object
-
-
Constructor Summary
Constructors Constructor Description SqlQueryBC(String url)default Constructor only with urlSqlQueryBC(String driver, String url, String user, String password)default constuctor setting fieldsSqlQueryBC(Connection con)Contructor with aConnectionto use
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Booleanexecute(String sql)Booleanexecute(String sql, List<Object> params)StringgetLastExecute()helper Method to get the last SQL Statementperformed inexecute(String, List)to turn on tracing seeTracingConfiguration.SQLStringgetLastRetrieve()helper Method to get the last SQL Statemen tperformed inretrieve(String, List)to turn on tracing seeTracingConfiguration.SQLStringgetLastSql()helper Method to get the last SQL Statementperformed to turn on tracing seeTracingConfiguration.SQLResultSetretrieve(String sql)ResultSetretrieve(String sql, List<Object> params)
-
-
-
Constructor Detail
-
SqlQueryBC
public SqlQueryBC(String url)
default Constructor only with url- Parameters:
url- theurlto connect to
-
SqlQueryBC
public SqlQueryBC(String driver, String url, String user, String password) throws ClassNotFoundException
default constuctor setting fields- Parameters:
driver- the classname of the driver in useurl- theurlto connect touser- username for the given sql connectionpassword- password for the given connection- Throws:
ClassNotFoundException- if the given driver can not be found byClassLoader
-
SqlQueryBC
public SqlQueryBC(Connection con) throws SQLException
Contructor with aConnectionto use- Parameters:
con- theConnectionto use to interact with- Throws:
SQLException- ifConnection.isClosed()throws aSQLException
-
-
Method Detail
-
retrieve
public ResultSet retrieve(String sql) throws SQLException
- Throws:
SQLException
-
retrieve
public ResultSet retrieve(String sql, List<Object> params) throws SQLException
- Throws:
SQLException
-
execute
public Boolean execute(String sql) throws SQLException
- Throws:
SQLException
-
execute
public Boolean execute(String sql, List<Object> params) throws SQLException
- Throws:
SQLException
-
getLastSql
public String getLastSql()
helper Method to get the last SQL Statementperformed to turn on tracing seeTracingConfiguration.SQL- Returns:
- the last performed and logged SQL statement. Can be
null
-
getLastRetrieve
public String getLastRetrieve()
helper Method to get the last SQL Statemen tperformed inretrieve(String, List)to turn on tracing seeTracingConfiguration.SQL- Returns:
- the last performed and logged SQL statement by
retrieve(String, List). Can benull
-
getLastExecute
public String getLastExecute()
helper Method to get the last SQL Statementperformed inexecute(String, List)to turn on tracing seeTracingConfiguration.SQL- Returns:
- the last performed and logged SQL statement by
retrieve(String, List). Can benull
-
-