codice:public String [] Nome_Person(String Nometabella){ int conta; try{ //STEP 2: Register JDBC driver Class.forName("com.mysql.jdbc.Driver"); //STEP 3: Open a connection System.out.println("Connecting to database..."); conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/", "root",""); //STEP 4: Execute a query System.out.println("Creating database..."); stmt = conn.createStatement(); String sql = "USE STUDENTS;"; stmt.executeUpdate(sql); String queryfinal="SELECT* FROM "; String querytabella=queryfinal.concat(Nometabella).concat(";"); System.out.println(""+querytabella); ResultSet rs = stmt.executeQuery(querytabella); conta=this.query3(Nometabella); Nomeperson=new String[conta]; ArrayList <String> list = new ArrayList <String> (); while (rs.next()) { Nome2=rs.getString("Nome"); Cognome2=rs.getString("Cognome"); pers=new Person(Nome2,Cognome2); pers.setNome(Nome2); pers.setCognome(Cognome2); Cognomeperson=new String[conta]; for(int i=0;i<conta;i++){ Nomeperson[i]=pers.getNome(); System.out.println("Nome persona"+Nomeperson[i]); } } //Create and set up the window. System.out.println("Database created successfully..."); }catch(SQLException se){ //Handle errors for JDBC se.printStackTrace(); }catch(Exception e){ //Handle errors for Class.forName e.printStackTrace(); }finally{ //finally block used to close resources try{ if(stmt!=null) stmt.close(); }catch(SQLException se2){ }// nothing we can do }//end try System.out.println("Goodbye!"); System.out.println("Nome"+pers.getNome()); return Nomeperson; }