Ciao
sapete per caso come realizzare un grafico partendo da una query sql?
Io stavo pensando ad una serie di Livelli di divero colore e altezza posizionati nella pagina, ma sembrerebbe una cosa un po grossolana, che consiglio mi date?
Utilizzo questa pagina:
codice:<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %> <%@ include file="Connections/JDOBMy.jsp" %> <% // funzione utile per calcolare le ore dgli allievi o docenti o tutore inseriti nei records Driver DriverRecordset1 = (Driver)Class.forName(MM_JDOBMy_DRIVER).newInstance(); Connection ConnRecordset1 = DriverManager.getConnection(MM_JDOBMy_STRING,MM_JDOBMy_USERNAME,MM_JDOBMy_PASSWORD); int nome = 0; int cognome = 0; int indirizzo = 0; // Per effettuare una ricerca inserire la stringa verde in sql con le variabili prese dai form con param. PreparedStatement StatementRecordset1 = ConnRecordset1.prepareStatement("SELECT studenti.Nome, Sum(studenti.Cognome) AS cognome, Sum(studenti.indirizzo) AS indirizzo FROM studenti GROUP BY studenti.Nome"); ResultSet Recordset1 = StatementRecordset1.executeQuery(); boolean Recordset1_isEmpty = !Recordset1.next(); boolean Recordset1_hasData = !Recordset1_isEmpty; Object Recordset1_data; int Recordset1_numRows = 0; %> <% int Repeat1__numRows = -1; int Repeat1__index = 0; Recordset1_numRows += Repeat1__numRows; %> <html> <head> <title>Documento senza titolo</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <table width="616" border="0"> <tr> <td width="193">Nome</td> <td width="147">Cognome</td> <td width="192">Indirizzo</td> </tr> <% while ((Recordset1_hasData)&&(Repeat1__numRows-- != 0)) { %> <tr> <td><%=(((Recordset1_data = Recordset1.getObject("Nome"))==null || Recordset1.wasNull())?"":Recordset1_data)%></td> <td><%=(((Recordset1_data = Recordset1.getObject("Cognome"))==null || Recordset1.wasNull())?"":Recordset1_data)%></td> <td><%=(((Recordset1_data = Recordset1.getObject("Indirizzo"))==null || Recordset1.wasNull())?"":Recordset1_data)%></td> </tr> <% Repeat1__index++; Recordset1_hasData = Recordset1.next(); } %> </table> </p> </p> </body> </html> <% Recordset1.close(); StatementRecordset1.close(); ConnRecordset1.close(); %>

Rispondi quotando