Revision 48012
Added by Tsampikos Livisianos almost 7 years ago
SqlDAO.java | ||
---|---|---|
53 | 53 |
* |
54 | 54 |
* @throws Exception |
55 | 55 |
*/ |
56 |
public String executePreparedQuery(String q, ArrayList<String> data) throws SQLException, SQLStoreException {
|
|
56 |
public ResultSet executePreparedQuery(String q, ArrayList<Object> data) throws SQLException, SQLStoreException {
|
|
57 | 57 |
|
58 | 58 |
ResultSet rs = sqlStore.executeQuery(q, data); |
59 |
return sqlStore.getResults(rs); |
|
59 |
return rs; |
|
60 |
//return sqlStore.getResults(rs); |
|
60 | 61 |
} |
61 | 62 |
|
62 | 63 |
/** |
... | ... | |
92 | 93 |
|
93 | 94 |
|
94 | 95 |
} |
96 |
public boolean executeUpdateQuery(String q, ArrayList<Object> params) throws Exception { |
|
97 |
try { |
|
98 |
log.debug("Executing query " + q); |
|
99 |
return sqlStore.executeUpdate(q, params); |
|
95 | 100 |
|
101 |
} catch (Exception e) |
|
102 |
|
|
103 |
{ |
|
104 |
log.debug("\n Query is:"+q); |
|
105 |
log.error("Fail to execute query:" + q, e); |
|
106 |
throw new Exception(e); |
|
107 |
} |
|
108 |
|
|
109 |
} |
|
110 |
|
|
96 | 111 |
public void executeUpdateQuery(String q) throws Exception { |
97 | 112 |
try { |
98 | 113 |
log.debug("Executing query " + q); |
Also available in: Unified diff
prepared statements for the sql queries