lundi 30 janvier 2017

I am working on a project.i need to read a value from my table and display the elements randomly in jlabel

public void load(int n) {
try { PreparedStatement ps=c.prepareStatement("SELECT letter FROM manage WHERE slno ="+n); ResultSet rs=ps.executeQuery();

         if(rs.next()==true)
         {
             jlabel.setText(rs.getString("letter"));
              a=rs.getString("letter");
         }


    }
    catch(Exception e)
    {
        e.printStackTrace();
    }
}




Aucun commentaire:

Enregistrer un commentaire