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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:38:24+00:00 2026-05-26T22:38:24+00:00

I tried to connect my java program to Access DB using jdbc-odbc bridge when

  • 0

I tried to connect my java program to Access DB using jdbc-odbc bridge when I write my connection code this Exception is thrown and I could not solve the problem

java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
    at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6957)
    at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7114)
    at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.java:3073)
    at sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:323)
    at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:174)
    at java.sql.DriverManager.getConnection(DriverManager.java:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:207)
    at jdbc.TestAccesDBCon.getConnection(TestAccesDBCon.java:44)
    at jdbc.TestAccesDBCon.main(TestAccesDBCon.java:21)

This is my code :

public static void main(String[] args) throws Exception {
    Connection conn = getConnection();
    Statement st = conn.createStatement();
    st = conn.createStatement();
    ResultSet rs = st.executeQuery("SELECT * FROM users");
    ResultSetMetaData rsMetaData = rs.getMetaData();
    int numberOfColumns = rsMetaData.getColumnCount();
    System.out.println("resultSet MetaData column Count=" + numberOfColumns);
    st.close();
    conn.close();
  }

  private static Connection getConnection() throws Exception {
    String driver = "sun.jdbc.odbc.JdbcOdbcDriver";  
    String connectionString = "jdbc:odbc:Driver= " +
"{Microsoft Access Driver (*.accdb)};DBQ=TestDB.accdb;DriverID=01";
    Class.forName(driver);
    return DriverManager.getConnection(connectionString);
  }

why this exception is thrown? please help?

  • 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-26T22:38:24+00:00Added an answer on May 26, 2026 at 10:38 pm

    Seems that you don’t have installed the ODBC Access Driver (ODBC drivers are optional when Access is installed !), try to install drivers from Access installation media, if you are on a 64 bit system you should install the 64 bit version of the driver.

    If you, going in ODBC Manager GUI in Amministrative Tools under the control panel, won’t find under the sources tab the source :

    Microsoft Access Driver (*.accdb)
    

    this means that the driver are not installed on your system and you need to install it.

    You can download Access 2010 driver from here .

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

Sidebar

Related Questions

I tried to connect to SerialPort COM6 using (Windows XP) javax.comm library with this
In my code i tried to connect signal from QTrayIcon object and my form
I am learning PHP and tried to connect to MySQL. Altough I am using
How can we connect a PHP script to MS Access (.mdb) file? I tried
I have (java) code that creates and populates tables in a derby database, using
I am using JTDS with Java to connect to a Microsoft SQL database. I
I have a problem with a really slow connection between my Java code and
I'm using BlazeDS to connect Flex with Java. I'm having trouble passing ArrayLists of
I created a java program that would just read a webpages code... google's for
I tried installing this at home along with Java SDK... The SDK worked fine

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.