Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
3.0
-
None
-
None
-
Jboss 4.0.3 SP1
Description
Hello the class DefaultJDBCAdapter have a littel error.
in doGetids method you put :
DefaultJDBCAdapter.java
public String[] doGetIds(Connection connection) throws SQLException, IOException { PreparedStatement s = null; ResultSet rs = null; try { List ids = new ArrayList(); s = connection.prepareStatement(statements.getFindAllIdsStatement()); rs = s.executeQuery(); while (!rs.next()) { // <---------- ERROR ids.add(rs.getString(1)); } return (String[]) ids.toArray(new String[ids.size()]); } finally { close(rs); close(s); } }
but this have a error, because when i execute query never i will added the content. The correct is:
DefaultJDBCAdapter.java
public String[] doGetIds(Connection connection) throws SQLException, IOException { PreparedStatement s = null; ResultSet rs = null; try { List ids = new ArrayList(); s = connection.prepareStatement(statements.getFindAllIdsStatement()); rs = s.executeQuery(); while (rs.next()) { // <---------- OK ids.add(rs.getString(1)); } return (String[]) ids.toArray(new String[ids.size()]); } finally { close(rs); close(s); } }
This is a simple path
Thanks: