@title: parse @desc Select解析器
(String sql)
| 140 | * @desc Select解析器 |
| 141 | */ |
| 142 | public static Select parse(String sql) { |
| 143 | switch (SqlParseConfig.getHandle()) { |
| 144 | case "com.github.jsqlparser":{ |
| 145 | try { |
| 146 | return com.sql.parse.statement.impl.jsqlparser.Select.parse(sql); |
| 147 | } catch (ClassCastException e) { |
| 148 | throw BaseException.errorCode(SqlParseConstant.CODE_020, "Select"); |
| 149 | } |
| 150 | } |
| 151 | case "com.alibaba.druid":{ |
| 152 | try { |
| 153 | return com.sql.parse.statement.impl.druid.Select.parse(sql); |
| 154 | } catch (ClassCastException e) { |
| 155 | throw BaseException.errorCode(SqlParseConstant.CODE_020, "Select"); |
| 156 | } |
| 157 | } |
| 158 | default:{ |
| 159 | throw BaseException.errorCode(SqlParseConstant.CODE_018); |
| 160 | } |
| 161 | } |
| 162 | } |
| 163 | } |