Package org.jdbi.v3.core.statement
Interface SqlParser
-
- All Known Implementing Classes:
CachingSqlParser,ColonPrefixSqlParser,HashPrefixSqlParser
public interface SqlParserParses the named parameters out of an SQL statement, and returns theParsedSqlcontaining the JDBC-ready SQL statement, along with the type of parameters used (named or positional), the number, and the parameter name for each position (if applicable).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringnameParameter(java.lang.String rawName, StatementContext ctx)Convert rawName to a name as recognized by this parserParsedSqlparse(java.lang.String sql, StatementContext ctx)Parses the given SQL statement, and returns theParsedSqlfor the statement.
-
-
-
Method Detail
-
parse
ParsedSql parse(java.lang.String sql, StatementContext ctx)
Parses the given SQL statement, and returns theParsedSqlfor the statement.- Parameters:
sql- The SQL statement to parsectx- The statement context for the statement being executed- Returns:
- the parsed SQL representing the SQL statement itself along with information about the parameters which should be bound (number and names)
-
nameParameter
java.lang.String nameParameter(java.lang.String rawName, StatementContext ctx)Convert rawName to a name as recognized by this parser- Parameters:
rawName- the raw name to transformctx- The statement context for the statement being executed- Returns:
- a name appropriate for being identified a a named parameter by this parser
-
-