no save
Assistance
Achat
News

Forum | programmation
[JAVA]Rafraichissement JTable
SamC7, le ven. 26 juin 2009 à 15:34:42
Bonjour,
Voilà j'ai un code en java, avec une JTable qui se remplit à partir d'une BDD. Voici le code pour la remplir :
state = cnx.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
result=state.executeQuery("SELECT id, descr FROM dbo.Pratica WHERE id NOT IN (SELECT id_pratica FROM Faldone WHERE id_scomparto IS NOT NULL)ORDER BY id");

String[] fields={"ID","DESCR"}; //champs/titres des colones
Object[][] datas=null; //données à afficher

try
{
j =0;
if(result.last())
{
datas=new Object[result.getRow()][fields.length];
result.beforeFirst();
while(result.next())
{
for(int i=0;i<fields.length;i++)
{
datas[result.getRow()-1][i]=result.getString(fields[i]);
}
j++;

}System.out.println(j);
}
else
{
System.out.println("Aucune donnée à afficher...");
}
}
catch(Exception e)
{
System.out.println("Erreur");
e.printStackTrace();
}
table = new JTable(datas, fields);
table.removeEditor();
Ma question est de savoir comment la rafraichir après un DELETE ?
J'espère que je suis assez clair ^^"Configuration: Windows XP
Firefox 3.0


SamC7
26 juin
Suivant
REPONSES
SamC7
26 juin
biboo
26 juin
biboo
26 juin
SamC7
26 juin
SamC7
26 juin
Version Web
Réalisé par RedShift
no save