It's normal that you get a missing return statement error because you are
missing a return statement :) If an exception is thrown in the try-block,
you go to the catch and after the catch-block there is no return-statement
so you've got to return something at the end.

                .....
            connection.close ();
            return Tab;

       }
       catch(Exception e){
            System.out.println ();
            System.out.println ("ERROR: " + e.getMessage());
       }

-->> return null; // or return Tab, or return something else
 }



>
> Hi,
> This is not a tomcat's question. I've made a class with a find method.
> When I compile it with ANT, I 've a missing return statement error whereas
> i've specified  return type.
> Here is the code :
>
>
> public String [] find(String mail) {
>             String system= "qs44a6005";
>             String collectionName="JC";
>             String Table="T_Client";
>             String[] Tab=null;
>
>             // Obtenir les paramètres de la requête.
>             Connection connection=null;
>
>
>       try{
>             // Chargement du driver JDBC pour AS/400.
>
>             DriverManager.registerDriver(
>                         new com.ibm.as400.access.AS400JDBCDriver());
>
>             // Obtient une connection à la database.
>             connection = DriverManager.getConnection ("jdbc:as400://" +
> system+ "/" + collectionName,"PCS","PCS");
>             Statement lireTable = connection.createStatement ();
>             ResultSet rs1= lireTable.executeQuery("SELECT
> NOM,CODE,TEL,PORT,PASS FROM "+collectionName+"."+Table+" WHERE MAIL='"
> +mail+"'");
>             if(rs1.next()){
>                   // on récupére les membres du resultSet
>                   Tab[0]=rs1.getString("NOM");
>                   Tab[1]=rs1.getString("CODE");
>                   Tab[2]=rs1.getString("TEL");
>                   Tab[3]=rs1.getString("PORT");
>                   Tab[4]=rs1.getString("PSWD");
>
>             }
>
>             System.out.println("fin test existe");
>             lireTable.close();
>             connection.close ();
>             return Tab;
>
>       }
>       catch(Exception e){
>             System.out.println ();
>             System.out.println ("ERROR: " + e.getMessage());
>       }
>
>
> }
>
>
> Thanks.
>
> garsJC
>
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to