@Test public void stripTimestamp2() { String sql = new QueryStripper("SELECT * FROM Table WHERE col = '1999-3-4 13:13:56.100'").getStrippedSql(); Assertions.assertEquals(sql, "SELECT * FROM \"TABLE\" WHERE \"COL\" = '2000-01-01 12:00:00'"); }
public String getStrippedSql() { String secureQuery = new SqlSecurer(sql).getSecureSql(); Select stmt = null; try { stmt = (Select) CCJSqlParserUtil.parse(secureQuery); } catch (JSQLParserException e) { throw new RuntimeException(e); } stmt.getSelectBody().accept(new QueryStripperVisitor()); return stmt.toString(); }
QueryStripper { public String getStrippedSql() { String secureQuery = new SqlSecurer(sql).getSecureSql(); Select stmt = null; try { stmt = (Select) CCJSqlParserUtil.parse(secureQuery); } catch (JSQLParserException e) { throw new RuntimeException(e); } stmt.getSelectBody().accept(new QueryStripperVisitor()); return stmt.toString(); } }
QueryStripper { public String getStrippedSql() { String secureQuery = new SqlSecurer(sql).getSecureSql(); Select stmt = null; try { stmt = (Select) CCJSqlParserUtil.parse(secureQuery); } catch (JSQLParserException e) { throw new RuntimeException(e); } stmt.getSelectBody().accept(new QueryStripperVisitor()); return stmt.toString(); } QueryStripper(String sql); }
QueryStripper { public String getStrippedSql() { String secureQuery = new SqlSecurer(sql).getSecureSql(); Select stmt = null; try { stmt = (Select) CCJSqlParserUtil.parse(secureQuery); } catch (JSQLParserException e) { throw new RuntimeException(e); } stmt.getSelectBody().accept(new QueryStripperVisitor()); return stmt.toString(); } QueryStripper(String sql); String getStrippedSql(); }
QueryStripper { public String getStrippedSql() { String secureQuery = new SqlSecurer(sql).getSecureSql(); Select stmt = null; try { stmt = (Select) CCJSqlParserUtil.parse(secureQuery); } catch (JSQLParserException e) { throw new RuntimeException(e); } stmt.getSelectBody().accept(new QueryStripperVisitor()); return stmt.toString(); } QueryStripper(String sql); String getStrippedSql();  }