Escaping Strings
Tim Gustafson <[email protected]> Mon, 11 Jul 2016 21:34:38 -0700
| Newsgroups | gmane.comp.db.mysql.java |
|---|---|
| Message-ID | <CACMcHMfmJs+HhT9H1=v-L7peXQCoxDQpezUpdXUhDKQrMb=meQ@mail.gmail.com> |
Hello, I'm trying to build a query builder, similar to the one implemented in PHP in the Drupal project. This requires that I be able to reliably escape MySQL identifiers (tables, columns, etc) and column values. However, there does not appear to be any methods exposed from the MySQL Java connector to do this. I know PerparedStatements are the way to go for SQL, and I use PreparedStatements whenever possible, but they just don't work for query builders. I know there are tools like JOOQ that do query building, but I want to build something that is very syntactically similar to the Drupal query builder, and JOOQ (and other projects like it) seem pretty far off that mark. Does the MySQL Java driver not expose mysql_real_escape_string, and is there no equivalent for safely escape identifiers like table names and column names? -- Tim Gustafson [email protected] -- MySQL Java Mailing List For list archives: http://lists.mysql.com/java To unsubscribe: http://lists.mysql.com/java