anjumr06 / squiggle-sql

Automatically exported from code.google.com/p/squiggle-sql
0 stars 0 forks source link

Adding Bind variable support for PreparedStatements #18

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I've done some local work to solve this for myself, can you add this or would 
you need to test more extensively.

1. update Literal.java, by adding before abstract method:
public static final String BINDVARIABLE = "?";

2. update StringLiteral.java's method, by adding after null check:

if (Literal.BINDVARIABLE.equals(s)) return s;

Use this is:
select.addCriteria(new MatchCriteria(<table>, <column>, <criteria>, 
Literal.BINDVARIABLE));

regards
Mark

Original issue reported on code.google.com by mark.gay...@gmail.com on 11 Jun 2011 at 6:02