|
From: Irina Z. <i_z...@us...> - 2004-03-31 21:24:46
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/core/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5624/src/org/cobricks/core/db Modified Files: DBAccessImpl.java Log Message: Processing of Set of values for sqlQuery(String, List, int) Index: DBAccessImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/core/db/DBAccessImpl.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- DBAccessImpl.java 23 Feb 2004 08:20:59 -0000 1.6 +++ DBAccessImpl.java 31 Mar 2004 21:12:55 -0000 1.7 @@ -433,10 +433,10 @@ } protected void setPreparedObjects(PreparedStatement pstmt, - List objects) + Set objects) throws SQLException { - ListIterator i = objects.listIterator(); + Iterator i = objects.iterator(); int count = 1; while (i.hasNext()) { Object o = i.next(); @@ -479,7 +479,7 @@ pstmt.setString(position, ""); } else { - pstmt.setString(position, o.toString()); + pstmt.setString(position, o.toString().trim()); } } return 1; @@ -833,7 +833,15 @@ int pcount = 1; ListIterator i = objects.listIterator(); while (i.hasNext()) { - setPreparedObject(pstmt, i.next(), pcount++); + Object next = i.next(); + if (next instanceof Set) { + Set nextList = (Set) next; + setPreparedObjects(pstmt, nextList); + + } + else{ + setPreparedObject(pstmt, next, pcount++); + } } ResultSet rs = pstmt.executeQuery(); while (rs.next()) { |