Class DenyStatementClassManager
java.lang.Object
org.kawanfw.sql.api.server.firewall.DefaultSqlFirewallManager
org.kawanfw.sql.api.server.firewall.DenyStatementClassManager
- All Implemented Interfaces:
SqlFirewallManager
public class DenyStatementClassManager extends DefaultSqlFirewallManager implements SqlFirewallManager
Firewall manager that denies any call of the raw
Statement
class. (Calling Statements without parameters is forbidden).- Since:
- 4.0
- Author:
- Nicolas de Pomereu
-
Constructor Summary
Constructors Constructor Description DenyStatementClassManager()
-
Method Summary
Modifier and Type Method Description boolean
allowStatementClass(String username, String database, Connection connection)
Allows to define if the passed username is allowed to create and use aStatement
instance that is not aPreparedStatement
.Methods inherited from class org.kawanfw.sql.api.server.firewall.DefaultSqlFirewallManager
allowExecute, allowMetadataQuery, allowSqlRunAfterAnalysis
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.kawanfw.sql.api.server.firewall.SqlFirewallManager
allowExecute, allowMetadataQuery, allowSqlRunAfterAnalysis
-
Constructor Details
-
DenyStatementClassManager
public DenyStatementClassManager()
-
-
Method Details
-
allowStatementClass
public boolean allowStatementClass(String username, String database, Connection connection) throws IOException, SQLExceptionDescription copied from interface:SqlFirewallManager
Allows to define if the passed username is allowed to create and use aStatement
instance that is not aPreparedStatement
.- Specified by:
allowStatementClass
in interfaceSqlFirewallManager
- Overrides:
allowStatementClass
in classDefaultSqlFirewallManager
- Parameters:
username
- the client username to check the rule fordatabase
- the database name as defined in the JDBC URL fieldconnection
- The current SQL/JDBCConnection
- Returns:
false
. (Nobody is allowed to create rawStatement
, i.e. call statements without parameters.)- Throws:
IOException
- if an IOException occursSQLException
- if a SQLException occurs
-