1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
| public void onTick(long millisUntilFinished) {
// mTextField.setText("seconds remaining: " + millisUntilFinished / 1000);
nb_alerte.setText(""+nb_alerte());
}
public void onFinish() {
// mTextField.setText("done!");
}
}.start();
public int nb_alerte(){
//Cursor curosr_1 = myDb.getclipr();
//Cursor curosr = myDb.get_date();
//String ladate = curosr.getString(0);
int total = 0 ;
Cursor cursor = myDb.getusers();
cursor.moveToLast();
//String _login = cursor.getString(0);
connect = CONN("sa", "sa", "toto", "toto-PC");
String query = "select * from alerte ";
ResultSet rs;
try{
Statement statement = connect.createStatement();
rs = statement.executeQuery(query);
total = getRows(rs);
/*
while(rs.next()){
myDb.insertclipr(rs.getString("id_client"), rs.getString("id_produit"), rs.getString("qte"), rs.getString("etat_passage"));
}
*/
}
catch (Exception e) {
Log.e("ERRO",e.getMessage());
}
return total ;
//Toast.makeText(this, "Importation terminé !" , Toast.LENGTH_SHORT).show();
} |
Partager