Results 1 to 2 of 2
  1. #1
    Brokkoli3000 is offline Member
    Join Date
    Aug 2016
    Rep Power

    Default Java DB with JPA

    High everyone,

    I'm trying to create an application with access to a Java DB database, but for easier use I'd like to include JPA. Trying this out, I used the first implementation I found: glassfish.

    The Java DB itself works, because access via JDBC is possible. But when I try to connect over JPA with the following code...

    Java Code:
    try {
    	EntityManagerFactory factory = Persistence.createEntityManagerFactory("QuickStart");
    	EntityManager manager = factory.createEntityManager();
    } catch (Exception ex) {
    ... I get the following exception:

    Java Code:
    Local Exception Stack: 
    Exception [TOPLINK-4003] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Exception Description: Configuration error.  Class [sun.jdbc.odbc.JdbcOdbcDriver] not found.
    	at oracle.toplink.essentials.exceptions.DatabaseException.configurationErrorClassNotFound(
    	at oracle.toplink.essentials.sessions.DefaultConnector.loadDriver(
    	at oracle.toplink.essentials.sessions.DefaultConnector.connect(
    	at oracle.toplink.essentials.sessions.DatasourceLogin.connectToDatasource(
    	at oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(
    	at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.login(
    	at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.deploy(
    	at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.getServerSession(
    	at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(
    	at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(
    	at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerFactoryImpl.createEntityManager(
    	at startup.DBTest.main(
    But why is the application searching for a JdbcOdbc driver? Do I need it for a Java DB - JPA - interface? And if not, what else is needed and how can I tell it to use it?

    Any idea would be appreciated!

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Rep Power

    Default Re: Java DB with JPA

    How have you set up your persistence unit properly?
    What's the persistence.xml look like?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

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