Ajouter un commentaire

zineb2206_9777

public class Valeur extends javax.swing.JFrame {

 Vector vdata = null;

 private void chargerTableau() {
        Date d = new Date(jTextField1.getText());
        System.out.println(d);
        vdata = getListevaleur(d);
        Vector vcolonnename = (Vector) vdata.elementAt(0);
        vdata.removeElementAt(0);
        tablegroupe.setModel(new DefaultTableModel(vdata, vcolonnename));

    }


 public static Vector getListevaleur(Date d) {


        Vector vdata = new Vector();
        ResultSet rs = null;
        try {
            Connection conn = BDConnection.connecter();

            Statement stmt = null;
            try {
                stmt = (Statement) conn.createStatement();
                rs = stmt.executeQuery("select *  from Valeur ");
                ResultSetMetaData rsmd = rs.getMetaData();
                int colonneccount = rsmd.getColumnCount();
                Vector vcolonnename = new Vector();
                for (int i = 1; i <= colonneccount; i++) {
                    vcolonnename.addElement(rsmd.getColumnName(i));
                }
                vdata.addElement(vcolonnename);
                Vector vligne;
                while (rs.next()) {
                    System.out.println(rs.getString("d"));

                    vligne = new Vector();
                    for (int i = 1; i <= colonneccount; i++) {
                        vligne.addElement(rs.getObject(i));
                    }
                    vdata.addElement(vligne);
                }
            } finally {
                rs.close();
                stmt.close();
                BDConnection.deconnecter();
            }
        } catch (Exception e) {
        }
        return vdata;
    }

 private void jButton3MouseClicked(java.awt.event.MouseEvent evt) {                                      
        // TODO add your handling code here:

        Date d = new Date(jTextField1.getText());
        // getListevaleur(d);
        chargerTableau();
        chargerid();
    }                                     

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new Valeur().setVisible(true);
            }
        });
    }

excusez le désordre

Filtered HTML

Plain text

CAPTCHA
Cette question permet de vérifier que vous n'êtes pas un robot spammeur :-)
 DDD   EEEE  W     W  PPPP    QQQ   
D D E W W P P Q Q
D D EEE W W W PPPP Q Q
D D E W W W P Q QQ
DDD EEEE W W P QQQQ
Q