Note that there are some explanatory texts on larger screens.

plurals
  1. POWhere is my database file created
    primarykey
    data
    text
    <p>This is my file dataSqliteHelper and when I run the first time, the data file is created but I don't know where is it to get it and open it with a tool and view the file.</p> <pre><code>public class DataSQLiteHelper extends OrmLiteSqliteOpenHelper { public static final String DATABASE_NAME = "ventasdb.db"; private static final int DATABASE_VERSION = 1; private Context mContext; private Dao&lt;Customer, Integer&gt; customerDao; public DataSQLiteHelper(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); } @Override public void onCreate(SQLiteDatabase db, ConnectionSource conections) { try { TableUtils.createTable(connectionSource, Customer.class); } catch (Exception e) { Log.e(DataSQLiteHelper.class.getName(), "Can't create database", e); throw new RuntimeException(e); } } @Override public void onUpgrade(SQLiteDatabase db, ConnectionSource connectionSource, int oldVersion, int newVersion) { try { TableUtils.dropTable(connectionSource, Customer.class, true); } catch (SQLException e) { throw new RuntimeException(e); } catch (java.sql.SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } /** * Returns the Database Access Object (DAO) for our UserData class. It will * create it or just give the cached value. */ public Dao&lt;Customer, Integer&gt; getCustomerDao() { if (customerDao == null) { try { customerDao = getDao(Customer.class); } catch (java.sql.SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } return customerDao; } public boolean updateCustomer(Customer p) { boolean ret = false; if (customerDao != null) { try { customerDao = getDao(Customer.class); UpdateBuilder&lt;Customer, Integer&gt; updateBuilder = customerDao .updateBuilder(); updateBuilder.updateColumnValue("name", "PIRIPIPI"); // p.getName()); updateBuilder.updateColumnValue("cel", p.getCel()); updateBuilder.updateColumnValue("email", p.getEmail()); updateBuilder.updateColumnValue("address", p.getAddress()); updateBuilder.updateColumnValue("City", p.getCity()); // but only update the rows where the description is some value updateBuilder.where().eq("customerID", 0); // actually perform the update customerDao.update(p); customerDao.refresh(p); } catch (Exception e) { ret = false; e.printStackTrace(); } } return ret; } /** * Close the database connections and clear any cached DAOs. */ @Override public void close() { super.close(); } } </code></pre> <p>with this line I know that I give the file name </p> <pre><code>super(context, DATABASE_NAME, null, DATABASE_VERSION); </code></pre> <p>but where is it in the storage of the device?</p> <p><strong>By the way , can I change the path to store the file in the sd card ?</strong></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload