CB Lite 2.1 Java Database exists?

i’m trying to get Couchbase Lite 2.1 to work on my android application, but i’m pretty new in programming and in databases.

How can i check in Java if my Database already exists? And if it exists, how can i get access to this database?

Thanks for your answers


  You can use API "exists" which can let you know whether database exists or not. Using the API , you can also find the path of the database.

If you would like to access the file of the database. You can use cblite tool.
https://github.com/couchbase/couchbase-lite-core/tree/master/tools . This has all instructions how to use cblite tool which you can query the cblite db file

  You can get the path of DB file  on the console logs when it gets generated in Android studio. You can do adb shell and copy the DB file to your local machine by going to the path  mentioned in console logs.

I think he means programatically. You can check with the Database.exists static method.

I am getting error while i use this method
error: method exists in class Database cannot be applied to given types;
if (!Database.exists(“travel-sample”, context.getFilesDir())) {
required: no arguments
found: String,File
reason: actual and formal argument lists differ in length

@jitendracodehacker – please don’t post to an old, unrelated thread. Start a new thread for your question.