[ https://issues.apache.org/activemq/browse/SM-785?page=all ]

Guillaume Nodet resolved SM-785.
--------------------------------

    Fix Version/s: 3.1
       Resolution: Fixed
         Assignee: Guillaume Nodet

Author: gnodet
Date: Tue Dec 19 06:00:17 2006
New Revision: 488679

URL: http://svn.apache.org/viewvc?view=rev&rev=488679
Log:
SM-785: Error in method doGetIds in DefaultJDBCAdapter.java
Patch provided by Jorge Rodriguez Pedrianes, thx !

Modified:
   
incubator/servicemix/trunk/core/servicemix-services/src/main/java/org/apache/servicemix/jdbc/adapter/DefaultJDBCAdapter.java


> Error in method doGetIds in DefaultJDBCAdapter class
> ----------------------------------------------------
>
>                 Key: SM-785
>                 URL: https://issues.apache.org/activemq/browse/SM-785
>             Project: ServiceMix
>          Issue Type: Bug
>    Affects Versions: 3.0
>         Environment: Jboss 4.0.3 SP1
>            Reporter: Jorge Rodríguez Pedrianes
>         Assigned To: Guillaume Nodet
>             Fix For: 3.1
>
>
> Hello the class DefaultJDBCAdapter have a littel error.
>     in doGetids method you put :
> {code:title=DefaultJDBCAdapter.java|borderStyle=solid}
>   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);
>         }
>     }
> {code}
> but this have a error, because when i execute query never i will added the 
> content. The correct is:
> {code:title=DefaultJDBCAdapter.java|borderStyle=solid}
>   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);
>         }
>     }
> {code}
> This is a simple path :D
> Thanks:

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to