1 Reply Latest reply: Oct 5, 2012 7:56 AM by Tolls RSS

    Duplicate local variable ERROR in JSP

      I have a datasource in WebLogic which I need to use inside a JSP to query a database table.
      The problem is, I keep on getting the following error:
      “Duplicate local variable env: InitialContext env = new InitialContext(ht);”
      The first time I had this problem it made sense, I renamed the “env” variable to “thatos” and I still had the same problem where the error message kept referring to duplicate variable, “env”. I also commented out the entire line “InitialContext env = new InitialContext(ht);”, hoping to get a different error message, but I’m still getting the same error message: “Duplicate local variable env: InitialContext env = new InitialContext(ht);”
      Any Ideas as to what could be the issue?

      Here's my JSP Snippet:

                                         { Context ic = null;

                                         String SiteSectionToken = new String("'"+siteSection+"'");
                                         Hashtable ht = new Hashtable();
                                         ic = InitialContext(ht);
                                         DataSource ds = (DataSource)ic.lookup("jdbc/ucmConnection");
                                         Connection conn = ds.getConnection();
      Statement st1=conn.createStatement();
                                         String sql_retrive = "select "+selectionToken+" from intranetnavlist where value = "+SiteSectionToken+"";
                                         ResultSet rs=st1.execute(sql_retrive);
                                         ResultSetMetaData meta = rs.getMetaData();
                          int numColumns = meta.getColumnCount();
                                         while( rs.next()){
      outputs = rs.getString(selectionToken);

                                    } catch(Exception e) {