Hi,
I have problem connecting to a database, and no exceptions are raised.
This is my class.
publicclassdb{Connectionconnection;static{try{Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");System.out.println("driver ok");}catch(ClassNotFoundExceptione){System.out.println("the class driver cannot be loaded");}}publicConnectionconnect(Stringdatabase_name)throwsSQLException{Stringfilename=io.PATH_DB+database_name+".mdb";Stringdatabase="jdbc:ucanaccess://";database+=filename.trim();System.out.println(database);try{connection=DriverManager.getConnection(database);System.out.println("Ok connection");}catch(Exceptione){io.error("Connessione al database "+database_name+" non riuscita");connection=null;System.out.println(e);e.printStackTrace();}returnconnection;}
drivers and libraries are ok, as I can see in the console, I can see the connection string that is
jdbc:ucanaccess://C:\Users\paolo.SCRIPTA\YandexDisk\java\base\database\pagheorg.mdb
and I cannot see console log "ok connection" but even any fault trace.
It seems that the execution stops on getConnection row.
What am I doing wrong? Is it a normai behaviour?
I'm using 4.0.4 version.
Thank you!
Last edit: Paolo Parise 2019-11-28
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I have problem connecting to a database, and no exceptions are raised.
This is my class.
drivers and libraries are ok, as I can see in the console, I can see the connection string that is
jdbc:ucanaccess://C:\Users\paolo.SCRIPTA\YandexDisk\java\base\database\pagheorg.mdb
and I cannot see console log "ok connection" but even any fault trace.
It seems that the execution stops on getConnection row.
What am I doing wrong? Is it a normai behaviour?
I'm using 4.0.4 version.
Thank you!
Last edit: Paolo Parise 2019-11-28
It is only very slow in execution, my fault. It works.