CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2014

    How to read MDB file in java

    i want read a (.accdb) file and i approached by this way .Below is code but i am getting this error-- java.lang.NullPointerException
    package mdb;

    import java.io.File;
    import java.io.IOException;
    import java.util.Map;

    import com.healthmarketscience.jackcess.Database;
    import com.healthmarketscience.jackcess.Table;
    import com.healthmarketscience.jackcess.query.Query.Row;
    import mdb.DatabaseBuilder;

    public class Readwritemdb {

    public static void main(String[] args) throws IOException {
    try {
    String path="D:\\Anand\\mymdb.accdb";
    Database db = DatabaseBuilder.open(new File(path));
    Table table = db.getTable("ContractInfo");

    for(Map row : table) {
    System.out.println("Column 'a' has value: " + row.get("a"));

    } catch (IOException e) {




    please help

  2. #2
    Join Date
    Jun 1999
    Eastern Florida

    Re: How to read MDB file in java

    What variable has the null value? Look at the error message for the line number for where the error happens, then look at the line and find the variable, then backtrack in the code to find out why that variable does not have a valid value.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.