You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Eric Blische <er...@comcast.net> on 2002/07/09 14:20:35 UTC

Re: missing return statement error?!??!

I think you need a return statement at the end of the method, too,
in case an exception is caught, handled, and control continues to
the end of the method.

Eric

----- Original Message -----
From: <st...@cristal-union.fr>
To: <to...@jakarta.apache.org>
Cc: <so...@xml.apache.org>
Sent: Tuesday, July 09, 2002 8:45 AM
Subject: missing return statement error?!??!


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:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>