Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6732525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:39:41+00:00 2026-05-26T10:39:41+00:00

I need to use a database on an Android application, since when in use

  • 0

I need to use a database on an Android application, since when in use the user won’t have internet access. For that, I want to do a connection to the database via JDBC with SQL Lite. After some research I found out that it is not supported by the Android API, but there is project which does just that: SQLDroid

I downloaded the jars and followed the main tutorial, but I keep getting an sql exception java.sql.SQLException: No suitable driver
when i want to create the connection with the DriverManager.

String url = "jdbc:sqldroid:" + "/data/data/com.mypackage.droid" + "/main.sqlite";
Connection con = DriverManager.getConnection(url);

What am I doing wrong?
By the way, my activity has the name “AndroidActivity” and the package is called com.mypackage.droid.

Edit: Complete code:

public class AndroidActivity extends Activity {


    String url = "jdbc:sqldroid:" + "/data/data/com.mypackage.droid" + "/main.sqlite";
    static Connection con;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        try {
            Class.forName("SQLite.JDBCDriver");
            con = DriverManager.getConnection(url);
        } catch (java.sql.SQLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (ClassNotFoundException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }


    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T10:39:42+00:00Added an answer on May 26, 2026 at 10:39 am

    Did you declare:

    Class.forName("SQLite.JDBCDriver");
    

    before declaring the connection?

    EDIT:

    Sorry I thought, that you want to use the native Android JDBC driver. In this case it would have been my approach.

    But since you are using the SQLDroid library which brings an own driver you have to register the driver first by smth. like:

    Class.forName("org.sqldroid.SqldroidDriver").newInstance();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have a use case wherein need to maintain a connection open to a database
The set-up: I have an android application that so far can register a user
I'm developing an application in android. I use an sqlite3 database. But I need
best solution for use access in project for database with security i need to
I have a fixed-length data file need to persistence into database. I use a
I have an android application using an SQLite database. I open the database when
I wish to use database for my application.How to use the database in android.I
Is there any sample? I have my android application and I need to connect
Background I have an Android project that has a database with two tables: tbl_question
I have in my android application a database table with geo pointes (lat and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.