Bonsoir,
pour quoi il m'affiche cette erreur ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
com.mysql.jdbc.exceptions.jdbc4.mysqlsyntaxerrorexception unknown column 'rowid' in 'order clause'
code:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 
    private void affi_munl(){
                try{
            String sql="SELECT Num_liv FROM Livraison ORDER BY rowid DESC LIMIT 1";
            if(conn!=null){pst=conn.prepareStatement(sql);}
            if(pst!=null){rs = pst.executeQuery();}
              if(rs!=null){
                if(rs.next()){
                    String add1=rs.getString("Num_liv");
                    int res = Integer.parseInt(add1)+1;
                    txt_num_liv.setText(Integer.toString(res));       
                }}
                    }catch(HeadlessException | SQLException e){
            JOptionPane.showMessageDialog(null,e);
        }finally{
            try{
                rs.close();
                pst.close();
            }catch(SQLException e){
        }
        } 
    }