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 8001639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:08:29+00:00 2026-06-04T16:08:29+00:00

I found some answers but nothing was useful. I added mysql-connector-java-5.1.7-bin.jar to referenced libraries

  • 0

I found some answers but nothing was useful.

I added mysql-connector-java-5.1.7-bin.jar to referenced libraries and the following method to my main class activity.

private void getServerData(String id, String type) throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException
{
    Log.i("Database Connection", " requesting data from server");

    Class.forName("com.mysql.jdbc.Driver").newInstance();               
    Connection con = DriverManager.getConnection("jdbc:mysql://10.0.2.2:3306/db_easy_maintenance", "root", "maintenance");
    Statement stm = con.createStatement();
    ResultSet rs = stm.executeQuery("SELECT Name FROM industrial_object");
    String entry;
    while(rs.next())
    {
        entry=rs.getString("Name");
        Log.i("Database Connection", "getting " + entry);
    }

    con.close();

}

I start my app and get an java.lang.ClassNotFoundException: com.mysql.jdbc.Driver at java.lang.Class.classForName.

If I don’t use try …catch… then i get this Exception before compiling.

What’s wrong?

  • 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-06-04T16:08:30+00:00Added an answer on June 4, 2026 at 4:08 pm

    see: http://developer.android.com/search.html#q=dx&t=0
    and Android JDBC not working: ClassNotFoundException on driver – my answer on the bottom gives ridiculously specific instructions, although I am curious how switching to 1.6 was useful.

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

Sidebar

Related Questions

I found some good answers for this question, but I can't really get them
I've found some other answers here, but they don't seem to apply/work, so I
I've found related questions (like this one ), but nothing that directly answers my
Ive found simlar posts before about this but nothing really answers the question. In
I've searched for an answer and found some c#-examples, but could not get this
Searched around on SO for an answer. Found some interesting stuff but I am
I found some classes designed for debugging in package com.sun.jdi like VirtualMachine , but
I've found variants of this problem on Stack Overflow but nothing my matches my
I've been searching around and looking for answers but I haven't found something that
I've done some searching and haven't found a specific answer. Anyhow, I was wondering

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.