}
public ResultSet executeQuery() throws SQLException {
try {
log.info("select stmt made for PreparedStmt: " + this.sql);
Select select = (Select) this.parserManager.parse(new StringReader(sql));
int qCount = StringUtils.countMatches(sql, "?");
for(int x = 0; x < qCount; x++){
String value = this.args.get(x);
this.sql = this.sql.replaceFirst("\\?", SimpleDBUtils.quoteValue(value));
}
log.info("after replacing ?'s, new sql is : " + this.sql);
String origDomain = ((PlainSelect) select.getSelectBody()).getFromItem().toString();
String domain =((PlainSelect) select.getSelectBody()).getFromItem().toString();
sql = sql.replaceAll(origDomain, SimpleDBUtils.quoteName(domain));
SelectRequest selectRequest = new SelectRequest(sql);
List<Item> items = this.connection.getSimpleDB().select(selectRequest)
.getItems();
return getSimpleDBResultSet(domain, items);