类 StatementCache
java.lang.Object
gu.sql2java.parser.StatementCache
基于
LoadingCache实现SQL语句解析格式化缓存,提高SQL语句分析的效率- 作者:
- guyadong
-
构造器概要
构造器构造器说明StatementCache(SqlFormatter sqlFormatter, SqlSyntaxNormalizer sqlSyntaxNormalizer) StatementCache(net.sf.jsqlparser.parser.CCJSqlParserDefaultVisitor vistor, SqlSyntaxNormalizer sqlSyntaxNormalizer) StatementCache(net.sf.jsqlparser.parser.CCJSqlParserVisitor vistor, SqlSyntaxNormalizer sqlSyntaxNormalizer) -
方法概要
修饰符和类型方法说明injectCheckEnable(boolean enable) 解析SQL语句,解析成功则返回由visitor归一化处理后的SQL语句, 否则将解析异常JSQLParserException封装到RuntimeDaoException抛出解析SQL语句,解析成功返回保存解析数据的ParserSupport.SqlParserInfo对象, 否则将解析异常JSQLParserException封装到RuntimeDaoException抛出prepareStatement(Connection c, String sql, boolean injectAnalyze, boolean debug, String logPrefix) 调用Connection.prepareStatement(String)创建预编译SQL语句PreparedStatement对象, 调用前执行normalize(String, boolean)方法对SQL语句进行归一化处理和安全检查prepareStatement(Connection c, String sql, boolean injectAnalyze, boolean debug, String logPrefix, int autoGeneratedKeys) 调用Connection.prepareStatement(String, int)创建预编译SQL语句PreparedStatement对象, 调用前执行normalize(String, boolean)方法对SQL语句进行归一化处理和安全检查prepareStatement(Connection c, String sql, boolean injectAnalyze, boolean debug, String logPrefix, int resultSetType, int resultSetConcurrency) 调用Connection.prepareStatement(String, int, int)创建预编译SQL语句PreparedStatement对象, 调用前执行normalize(String, boolean)方法对SQL语句进行归一化处理和安全检查
-
构造器详细资料
-
StatementCache
public StatementCache() -
StatementCache
public StatementCache(net.sf.jsqlparser.parser.CCJSqlParserDefaultVisitor vistor, SqlSyntaxNormalizer sqlSyntaxNormalizer) -
StatementCache
public StatementCache(net.sf.jsqlparser.parser.CCJSqlParserVisitor vistor, SqlSyntaxNormalizer sqlSyntaxNormalizer) -
StatementCache
-
-
方法详细资料
-
injectCheckEnable
-
parse
解析SQL语句,解析成功返回保存解析数据的ParserSupport.SqlParserInfo对象, 否则将解析异常JSQLParserException封装到RuntimeDaoException抛出- 参数:
sql-injectAnalyze- 为true执行注入攻击分析
-
normalize
解析SQL语句,解析成功则返回由visitor归一化处理后的SQL语句, 否则将解析异常JSQLParserException封装到RuntimeDaoException抛出- 参数:
sql-injectAnalyze- 为true执行注入攻击分析
-
prepareStatement
public PreparedStatement prepareStatement(Connection c, String sql, boolean injectAnalyze, boolean debug, String logPrefix, int resultSetType, int resultSetConcurrency) throws SQLException 调用Connection.prepareStatement(String, int, int)创建预编译SQL语句PreparedStatement对象, 调用前执行normalize(String, boolean)方法对SQL语句进行归一化处理和安全检查- 参数:
c- SQL connectionsql- sql statementinjectAnalyze- run injection attack analysis if truedebug- output SQL statement to console if truelogPrefix- prefix string for debug informationresultSetType- see alsoConnection.prepareStatement(String, int, int)resultSetConcurrency- see alsoConnection.prepareStatement(String, int, int)- 抛出:
SQLException- 另请参阅:
-
prepareStatement
public PreparedStatement prepareStatement(Connection c, String sql, boolean injectAnalyze, boolean debug, String logPrefix, int autoGeneratedKeys) throws SQLException 调用Connection.prepareStatement(String, int)创建预编译SQL语句PreparedStatement对象, 调用前执行normalize(String, boolean)方法对SQL语句进行归一化处理和安全检查- 参数:
c- SQL connectionsql- sql statementinjectAnalyze- run injection attack analysis if truedebug- output SQL statement to console if truelogPrefix- prefix string for debug informationautoGeneratedKeys- see alsoConnection.prepareStatement(String, int)- 抛出:
SQLException- 另请参阅:
-
prepareStatement
public PreparedStatement prepareStatement(Connection c, String sql, boolean injectAnalyze, boolean debug, String logPrefix) throws SQLException 调用Connection.prepareStatement(String)创建预编译SQL语句PreparedStatement对象, 调用前执行normalize(String, boolean)方法对SQL语句进行归一化处理和安全检查- 参数:
c- SQL connectionsql- sql statementinjectAnalyze- run injection attack analysis if truedebug- output SQL statement to console if truelogPrefix- prefix string for debug information- 抛出:
SQLException- 另请参阅:
-