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

  • SEARCH
  • Home
  • 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 6385415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:53:47+00:00 2026-05-25T02:53:47+00:00

I’m trying to use JDBC in my Android application to connect to a remote

  • 0

I’m trying to use JDBC in my Android application to connect to a remote database to do inserts, queries, etc. I have successfully connected and done these things in a different JAVA project. So I figured since Android is Java, I could just port over the relevant code, add the same build path for the driver, etc. But it gives me the error:

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

I really don’t think it’s a code issue since the same code works in a Java project (which I just execute in main()). But for reference here it is:

String url = "jdbc:mysql://localhost:3306/eventhub_test"; //
    String user = "root"; 
    String pass = "";

 SQLUtils sqlu = new SQLUtils(url, user, pass);

//the SQLUtils class I made:

public class SQLUtils {


private String CONNECTION_URL;
private String user;
private String pass;
private java.sql.Statement stmt; 
private java.sql.Connection conn;

public SQLUtils(String conn_url, String user, String pass) {
    this.CONNECTION_URL = conn_url; 
    this.user = user;
    this.pass = pass; 
}


public void init() throws IllegalAccessException, InstantiationException, ClassNotFoundException, SQLException {

    Class.forName ("com.mysql.jdbc.Driver").newInstance ();
    conn = DriverManager.getConnection(CONNECTION_URL, user, pass);
    stmt = conn.createStatement();

}
}

So I’m really confused here. Does JDBC not work with Android? If so, tell me what alternatives I should look into for remote MySQL database access.

Thanks.

  • 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-25T02:53:49+00:00Added an answer on May 25, 2026 at 2:53 am

    Does JDBC not work with Android?

    JDBC is infrequently used on Android, and I certainly would not recommend it.

    IMHO, JDBC is designed for high-bandwidth, low-latency, highly-reliable network connections (e.g., desktop to database server, Web application server to database server). Mobile devices offer little of these, and none of them consistently.

    If so, tell me what alternatives I should look into for remote MySQL database access.

    Create a Web service around your database and access that from Android.

    As side benefits, you improve security (vs. leaving your database open), can offload some business logic from the client, can better support other platforms (e.g., Web or Web-based mobile frameworks), etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I have a reasonable size flat file database of text documents mostly saved in
I am trying to loop through a bunch of documents I have to put
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into

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.