daily pastebin goal
49%
SHARE
TWEET

Untitled

a guest Oct 11th, 2018 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public void insert_artista(String n_cancion, String n_artista, String genero, String letra, String nota){
  2.         ContentValues contentValues = new ContentValues();
  3.         contentValues.put("NAME_CANCION", n_cancion);
  4.         contentValues.put("NAME_ARTISTA", n_artista);
  5.         contentValues.put("NAME_GERO",genero);
  6.         contentValues.put("NAME_LETRA",letra);
  7.         contentValues.put("NAME_NOTA",nota);
  8. this.getWritableDatabase().insertOrThrow("ARTISTA","",contentValues);}
  9.  
  10.     public List<CantanteDatos> mostrarArtistas(){
  11.         SQLiteDatabase bd=getReadableDatabase();
  12.         Cursor cursor = bd.rawQuery("SELECT * FROM ARTISTA",null);
  13.         List<CantanteDatos> cursos = new ArrayList<>();
  14.         if (cursor.moveToNext()){
  15.             do {
  16.                 cursos.add(new CantanteDatos(cursor.getString(0),cursor.getString(1), cursor.getString(2), cursor.getString(3), cursor.getString(4)));
  17.             }while (cursor.moveToNext());
  18.         }
  19.         return cursos;
  20.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top