Menu

Connecting to MS Access from Linux machine - taking a long time

2017-11-02
2017-11-02
  • Natarajan Chidhambharam

    I'm trying to execute the below code to check if I'm able to connect to my database.
    Note: I'm running this on a Linux machine

    import java.sql.Connection;
    import java.sql.DriverManager;
    
    public class test {
    public static void main(String[] args) {
        Connection connection = null;
        Long t0 = System.nanoTime();
        try 
        {
            String msAccDB = "/work/users/natarajan/test.accdb";
            String dbURL = "jdbc:ucanaccess://" + msAccDB;
    
            connection = DriverManager.getConnection(dbURL);
            System.out.printf("Database opened in %.3f seconds%n", 
                    (System.nanoTime() - t0) / 1000000000.0);
        } 
        catch (Exception e) {
            e.printStackTrace(System.err);
        }
    }
    }
    

    The code runs for a really long time and comes to a halt finally. Below is my output.

    WARNING:You shouldn't use 'user' reserved word as column name in the table Email_Event_Recipients (it refers to the database user).
    Escape it in your SQL!
    (e.g. SELECT [USER] FROM TABLE WHERE [USER]='Joe')
    WARNING:You shouldn't use 'user' reserved word as column name in the table Users (it refers to the database user).
    Escape it in your SQL!
    (e.g. SELECT [USER] FROM TABLE WHERE [USER]='Joe')
    WARNING:Unknown expression: GenUniqueID() (default value of column Counter table Cover)
    WARNING:Unknown expression: GenUniqueID() (default value of column Counter table Users)
    Database opened in 1733.578 seconds

    For opening the database, it takes close to 30 mins! the db size is 200 MB. Can you please help

     

    Last edit: Natarajan Chidhambharam 2017-11-02
  • Marco Amadei

    Marco Amadei - 2017-11-03

    What's your xmx? Are there BLOB columns in your db? Have you tried the skipIndexes=true parameter?

     
    • Natarajan Chidhambharam

      Hi Marco, the details regarding the heap size

      uintx AdaptivePermSizeWeight = 20 {product}
      intx CompilerThreadStackSize = 0 {pd product}
      uintx ErgoHeapSizeLimit = 0 {product}
      uintx InitialHeapSize := 262940224 {product}
      uintx LargePageHeapSizeThreshold = 134217728 {product}
      uintx MaxHeapSize := 4208984064 {product}
      uintx MaxPermSize = 85983232 {pd product}
      uintx PermSize = 21757952 {pd product}
      intx ThreadStackSize = 1024 {pd product}
      intx VMThreadStackSize = 1024 {pd product}

      There is one table that has a BLOB column (OLE data type). But there is no data in the table.

      I tried skipIndexes=true parameter in the code and still it is taking the same time to execute.

       
  • Markus Spann

    Markus Spann - 2017-11-11

    Hi Natarajan,
    are you able to share an (anonymized) version of your db for us to reproduce the behavior and look at it with a profiler.
    Is your table actually called 'table' ...? just curious
    which are your os and jre?
    cheers,
    Markus

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.