erreur methode java

erreur methode java - Java - Programmation

Marsh Posté le 29-05-2011 à 22:18:08    

salut  
 
quel est l'erreur de cette méthode SVP?
 

Code :
  1. @WebMethod(operationName = "opera" )
  2.     public JTable opera (@WebParam(name = "keys" )
  3.     String keys)  {
  4.          JTable table =null;
  5.      
  6.             String[] columnNames = {"Videos", "Information"};
  7.             //---------Cconnexion à la base de données:----------------------
  8.             String username = "root";
  9.             String password = "0000";
  10.             Statement stmt = null;
  11.             ResultSet rs;
  12.             try {
  13.                 try {
  14.                     Class.forName("com.mysql.jdbc.Driver" ).newInstance();
  15.                 } catch (InstantiationException ex) {
  16.                     Logger.getLogger(Iden.class.getName()).log(Level.SEVERE, null, ex);
  17.                 } catch (IllegalAccessException ex) {
  18.                     Logger.getLogger(Iden.class.getName()).log(Level.SEVERE, null, ex);
  19.                 }
  20.             } catch (ClassNotFoundException ex) {
  21.                 Logger.getLogger(Iden.class.getName()).log(Level.SEVERE, null, ex);
  22.             }
  23.             String url = "jdbc:mysql://localhost:3306/mabase";
  24.             Connection conn = null;
  25.             try {
  26.                 conn = (Connection) DriverManager.getConnection(url, username, password);
  27.             } catch (SQLException ex) {
  28.                 Logger.getLogger(Iden.class.getName()).log(Level.SEVERE, null, ex);
  29.             }
  30.             try {
  31.                 stmt = (Statement) conn.createStatement();
  32.             } catch (SQLException ex) {
  33.                 Logger.getLogger(Iden.class.getName()).log(Level.SEVERE, null, ex);
  34.             }
  35.         try {
  36.             rs = stmt.executeQuery("select * from videos where nomVideo='" + keys + "'" );
  37.             int NbreResultats = rs.getRow();
  38.             System.out.println("Le nombre des résultats vaut " + NbreResultats);// to del
  39.              Object[][] data = new Object[NbreResultats][columnNames.length];
  40.             rs.beforeFirst();
  41.              //String NEWLINE = System.getProperty("line.separator" );
  42.             while (rs.next()) {
  43.             String Ligne1 = " Nom de la vidèo :" + rs.getString("nomVideo" );
  44.             String Ligne2 = " Catégorie       :" + rs.getString("categorie" );
  45.             String Ligne3 = " Durée           :" + rs.getString("duree" );
  46.             String im = rs.getString("lien" );
  47.             JLabel label = new JLabel("<html>" + Ligne1 + "<br>" + Ligne2 + "<br>" + Ligne3 + "<br>" +im+ "</html>" );
  48.             data[0][0] = null;
  49.             data[0][1] = label.getText();
  50.             // System.out.println(data[0][1].toString());
  51.             //rs.close();
  52.             //stmt.close();
  53.             table = new JTable(data, columnNames);
  54.             table.setPreferredScrollableViewportSize(new Dimension(958, 581));
  55.             table.setFillsViewportHeight(true);
  56.             //  ImageIcon iconv = new ImageIcon(im);//was ist das
  57.             table.getColumnModel().getColumn(0).setCellRenderer((TableCellRenderer) new ImageRenderer());
  58.             table.setRowHeight(300);
  59.             // JScrollPane scrollPane = new JScrollPane(table); //Create the scroll pane and add the table to it.
  60.             //add(scrollPane); //Add the scroll pane to this panel.
  61.             }
  62.      
  63.         } catch (SQLException ex) {
  64.             Logger.getLogger(Iden.class.getName()).log(Level.SEVERE, null, ex);
  65.         }
  66.         return table;
  67.     }


 
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

Reply

Marsh Posté le 29-05-2011 à 22:18:08   

Reply

Marsh Posté le 02-06-2011 à 23:48:13    

Peux-tu fournir la stacktrace associée à l'erreur?
--> ca peut aider à comprendre l'origine du problème...

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed