Search in sources :

Example 6 with OracleWallProvider

use of com.alibaba.druid.wall.spi.OracleWallProvider in project druid by alibaba.

the class WallStatTest_alter_table method testOracle.

public void testOracle() throws Exception {
    String sql = "alter table t add (fname varchar(50))";
    WallProvider provider = new OracleWallProvider();
    provider.getConfig().setAlterTableAllow(true);
    Assert.assertTrue(provider.checkValid(sql));
    WallTableStat tableStat = provider.getTableStat("t");
    Assert.assertEquals(1, tableStat.getAlterCount());
}
Also used : WallTableStat(com.alibaba.druid.wall.WallTableStat) OracleWallProvider(com.alibaba.druid.wall.spi.OracleWallProvider) WallProvider(com.alibaba.druid.wall.WallProvider) MySqlWallProvider(com.alibaba.druid.wall.spi.MySqlWallProvider) OracleWallProvider(com.alibaba.druid.wall.spi.OracleWallProvider) PGWallProvider(com.alibaba.druid.wall.spi.PGWallProvider) SQLServerWallProvider(com.alibaba.druid.wall.spi.SQLServerWallProvider)

Example 7 with OracleWallProvider

use of com.alibaba.druid.wall.spi.OracleWallProvider in project druid by alibaba.

the class WallStatTest_update method testOracle.

public void testOracle() throws Exception {
    WallProvider provider = new OracleWallProvider();
    Assert.assertTrue(provider.checkValid(sql));
    WallTableStat tableStat = provider.getTableStat("t");
    Assert.assertEquals(1, tableStat.getUpdateCount());
}
Also used : WallTableStat(com.alibaba.druid.wall.WallTableStat) OracleWallProvider(com.alibaba.druid.wall.spi.OracleWallProvider) WallProvider(com.alibaba.druid.wall.WallProvider) MySqlWallProvider(com.alibaba.druid.wall.spi.MySqlWallProvider) OracleWallProvider(com.alibaba.druid.wall.spi.OracleWallProvider) PGWallProvider(com.alibaba.druid.wall.spi.PGWallProvider) SQLServerWallProvider(com.alibaba.druid.wall.spi.SQLServerWallProvider)

Example 8 with OracleWallProvider

use of com.alibaba.druid.wall.spi.OracleWallProvider in project druid by alibaba.

the class WallDenySchemaTest method testORACLE.

public void testORACLE() throws Exception {
    String sql = "SELECT * FROM T UNION SELECT F1, F2 FROM ALL_ALL_TABLES";
    OracleWallProvider provider = new OracleWallProvider();
    Assert.assertFalse(provider.checkValid(sql));
}
Also used : OracleWallProvider(com.alibaba.druid.wall.spi.OracleWallProvider)

Example 9 with OracleWallProvider

use of com.alibaba.druid.wall.spi.OracleWallProvider in project druid by alibaba.

the class WallDenyTableTest method testORACLE.

public void testORACLE() throws Exception {
    String sql = "SELECT *FROM T UNION SELECT F1, F2 FROM SYS.ABC";
    OracleWallProvider provider = new OracleWallProvider();
    Assert.assertFalse(provider.checkValid(sql));
}
Also used : OracleWallProvider(com.alibaba.druid.wall.spi.OracleWallProvider)

Example 10 with OracleWallProvider

use of com.alibaba.druid.wall.spi.OracleWallProvider in project druid by alibaba.

the class WallStatTest_create_table method testOracle.

public void testOracle() throws Exception {
    WallProvider provider = new OracleWallProvider();
    provider.getConfig().setCreateTableAllow(true);
    Assert.assertTrue(provider.checkValid(sql));
    WallTableStat tableStat = provider.getTableStat("t");
    Assert.assertEquals(1, tableStat.getCreateCount());
}
Also used : WallTableStat(com.alibaba.druid.wall.WallTableStat) OracleWallProvider(com.alibaba.druid.wall.spi.OracleWallProvider) WallProvider(com.alibaba.druid.wall.WallProvider) MySqlWallProvider(com.alibaba.druid.wall.spi.MySqlWallProvider) OracleWallProvider(com.alibaba.druid.wall.spi.OracleWallProvider) PGWallProvider(com.alibaba.druid.wall.spi.PGWallProvider) SQLServerWallProvider(com.alibaba.druid.wall.spi.SQLServerWallProvider)

Aggregations

OracleWallProvider (com.alibaba.druid.wall.spi.OracleWallProvider)14 MySqlWallProvider (com.alibaba.druid.wall.spi.MySqlWallProvider)10 PGWallProvider (com.alibaba.druid.wall.spi.PGWallProvider)10 SQLServerWallProvider (com.alibaba.druid.wall.spi.SQLServerWallProvider)10 WallProvider (com.alibaba.druid.wall.WallProvider)9 WallTableStat (com.alibaba.druid.wall.WallTableStat)9 DB2WallProvider (com.alibaba.druid.wall.spi.DB2WallProvider)1