Package com.alibaba.druid.wall.spi

Examples of com.alibaba.druid.wall.spi.MySqlWallProvider


        if (JdbcUtils.MYSQL.equals(dbType)) {
            if (config == null) {
                config = new WallConfig(MySqlWallProvider.DEFAULT_CONFIG_DIR);
            }

            provider = new MySqlWallProvider(config);
        } else if (JdbcUtils.ORACLE.equals(dbType) || JdbcUtils.ALI_ORACLE.equals(dbType)) {
            if (config == null) {
                config = new WallConfig(OracleWallProvider.DEFAULT_CONFIG_DIR);
            }
View Full Code Here


        if (JdbcUtils.MYSQL.equals(dbType)) {
            if (config == null) {
                config = new WallConfig(MySqlWallProvider.DEFAULT_CONFIG_DIR);
            }

            provider = new MySqlWallProvider(config);
        } else if (JdbcUtils.ORACLE.equals(dbType)) {
            if (config == null) {
                config = new WallConfig(OracleWallProvider.DEFAULT_CONFIG_DIR);
            }
View Full Code Here

import com.alibaba.druid.wall.spi.SQLServerProvider;

public class WallUtils {

    public static boolean isValidateMySql(String sql) {
        MySqlWallProvider provider = new MySqlWallProvider();
        return provider.checkValid(sql);
    }
View Full Code Here

        MySqlWallProvider provider = new MySqlWallProvider();
        return provider.checkValid(sql);
    }

    public static boolean isValidateMySql(String sql, WallConfig config) {
        MySqlWallProvider provider = new MySqlWallProvider(config);
        return provider.checkValid(sql);
    }
View Full Code Here

        if (JdbcUtils.MYSQL.equals(dbType)) {
            if (config == null) {
                config = new WallConfig(MySqlWallProvider.DEFAULT_CONFIG_DIR);
            }

            provider = new MySqlWallProvider(config);
        } else if (JdbcUtils.ORACLE.equals(dbType)) {
            if (config == null) {
                config = new WallConfig(OracleWallProvider.DEFAULT_CONFIG_DIR);
            }
View Full Code Here

            JdbcUtils.H2.equals(dbType)) {
            if (config == null) {
                config = new WallConfig(MySqlWallProvider.DEFAULT_CONFIG_DIR);
            }

            provider = new MySqlWallProvider(config);
        } else if (JdbcUtils.ORACLE.equals(dbType) || JdbcUtils.ALI_ORACLE.equals(dbType)) {
            if (config == null) {
                config = new WallConfig(OracleWallProvider.DEFAULT_CONFIG_DIR);
            }
View Full Code Here

* @see
*/
public class MySqlWallTest78 extends TestCase {

    public void test_false() throws Exception {
        WallProvider provider = new MySqlWallProvider();
       
        Assert.assertFalse(provider.checkValid(//
        "SELECT * FROM T WHERE FID = ? OR LEAST(2,1,9,8) = 1"));

        Assert.assertEquals(1, provider.getTableStats().size());
    }
View Full Code Here

import com.alibaba.druid.wall.spi.MySqlWallProvider;

public class MySqlWallTest124 extends TestCase {

    public void test_false() throws Exception {
        WallProvider provider = new MySqlWallProvider();
        provider.getConfig().setCommentAllow(false);

        String sql = "SELECT name, '******' password, createTime from user where name like 'admin' AND 5859=5666 AND 'Cuqo' LIKE 'Cuqo'";

        Assert.assertFalse(provider.checkValid(sql));
    }
View Full Code Here

* @see
*/
public class MySqlWallTest58 extends TestCase {

    public void test_true() throws Exception {
        WallProvider provider = new MySqlWallProvider();
        provider.getConfig().setSchemaCheck(false);

        Assert.assertTrue(provider.checkValid(//
        "SELECT COUNT(*) FROM information_schema.processlist " + //
                "WHERE user <> 'replication' AND id <> CONNECTION_ID() " + //
                "AND time > 60 AND command <> 'Sleep'"));

        Assert.assertEquals(1, provider.getTableStats().size());
    }
View Full Code Here

* @see
*/
public class MySqlWallTest77 extends TestCase {

    public void test_false() throws Exception {
        WallProvider provider = new MySqlWallProvider();
       
        Assert.assertFalse(provider.checkValid(//
        "SELECT * FROM T WHERE FID = ? OR LEAST(2,0) = 0"));

        Assert.assertEquals(1, provider.getTableStats().size());
    }
View Full Code Here

TOP

Related Classes of com.alibaba.druid.wall.spi.MySqlWallProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.