Application works in eclipse and stops working after generating the executable JAR

0

I'm working on two applications here in the company that are giving me a certain headache for a reason that the solution should be simple plus I can not find the error, the two applications normally work within eclipse, more when I generate the .AR and run the programs outside of eclipse it generates an error regarding the database.

The funny thing is that one of the programs gives the same error, but for the Oracle 11g database drive the other one runs Oracle 11g and gives the uncanaccess drive problem.

What can it be?

Problem was solved through Denis comment, it was necessary to add the declaration below in the code;

    Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
Class.forName ("oracle.jdbc.OracleDriver");
    
asked by anonymous 05.01.2017 / 12:21

1 answer

3

In order to correct this problem, it is necessary to register the driver to be used, for this it is necessary to use Class.forName("net.ucanaccess.jdbc.UcanaccessDriver") , in this way the driver is loaded and you can open the connection without problems

    
05.01.2017 / 12:45