futuring | salut quel est l'erreur de cette méthode SVP?
Code :
- @WebMethod(operationName = "opera" )
- public JTable opera (@WebParam(name = "keys" )
- String keys) {
- JTable table =null;
-
- String[] columnNames = {"Videos", "Information"};
- //---------Cconnexion à la base de données:----------------------
- String username = "root";
- String password = "0000";
- Statement stmt = null;
- ResultSet rs;
- try {
- try {
- Class.forName("com.mysql.jdbc.Driver" ).newInstance();
- } catch (InstantiationException ex) {
- Logger.getLogger(Iden.class.getName()).log(Level.SEVERE, null, ex);
- } catch (IllegalAccessException ex) {
- Logger.getLogger(Iden.class.getName()).log(Level.SEVERE, null, ex);
- }
- } catch (ClassNotFoundException ex) {
- Logger.getLogger(Iden.class.getName()).log(Level.SEVERE, null, ex);
- }
- String url = "jdbc:mysql://localhost:3306/mabase";
- Connection conn = null;
- try {
- conn = (Connection) DriverManager.getConnection(url, username, password);
- } catch (SQLException ex) {
- Logger.getLogger(Iden.class.getName()).log(Level.SEVERE, null, ex);
- }
- try {
- stmt = (Statement) conn.createStatement();
- } catch (SQLException ex) {
- Logger.getLogger(Iden.class.getName()).log(Level.SEVERE, null, ex);
- }
- try {
- rs = stmt.executeQuery("select * from videos where nomVideo='" + keys + "'" );
- int NbreResultats = rs.getRow();
- System.out.println("Le nombre des résultats vaut " + NbreResultats);// to del
- Object[][] data = new Object[NbreResultats][columnNames.length];
- rs.beforeFirst();
- //String NEWLINE = System.getProperty("line.separator" );
- while (rs.next()) {
- String Ligne1 = " Nom de la vidèo :" + rs.getString("nomVideo" );
- String Ligne2 = " Catégorie :" + rs.getString("categorie" );
- String Ligne3 = " Durée :" + rs.getString("duree" );
- String im = rs.getString("lien" );
- JLabel label = new JLabel("<html>" + Ligne1 + "<br>" + Ligne2 + "<br>" + Ligne3 + "<br>" +im+ "</html>" );
- data[0][0] = null;
- data[0][1] = label.getText();
- // System.out.println(data[0][1].toString());
- //rs.close();
- //stmt.close();
- table = new JTable(data, columnNames);
- table.setPreferredScrollableViewportSize(new Dimension(958, 581));
- table.setFillsViewportHeight(true);
- // ImageIcon iconv = new ImageIcon(im);//was ist das
- table.getColumnModel().getColumn(0).setCellRenderer((TableCellRenderer) new ImageRenderer());
- table.setRowHeight(300);
- // JScrollPane scrollPane = new JScrollPane(table); //Create the scroll pane and add the table to it.
- //add(scrollPane); //Add the scroll pane to this panel.
- }
-
- } catch (SQLException ex) {
- Logger.getLogger(Iden.class.getName()).log(Level.SEVERE, null, ex);
- }
- return table;
- }
|
j'ai crée un web service contenent cette méthode : en déployant l'erreur suivante m'affiche
deploy?path=C:\Users...\build\web&name=WebApplication2&force=true failed on GlassFish Server 3
C:\...\nbproject\build-impl.xml:687: The module has not been deployed.
BUILD FAILED (total time: 5 seconds)
merci d'avance
|