Menu

Using eclipselink with ucanaccess create table error

Help
2014-11-20
2015-01-21
  • Vilson Balestero

    I trying ucanaccess directly, but now I want use it with eclipselink JPA, but when JPA tries to auto creates the database from class, I got this error below:

    [EL Info]: 2014-11-20 17:11:45.286--ServerSession(2070572804)--EclipseLink, version: Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd
    [EL Info]: connection: 2014-11-20 17:11:48.216--ServerSession(2070572804)--file:/D:/_DeveloperStudy/_Java/MavenProjects/smar-projects/drawingfx/target/classes/_MSAccessDB_url=jdbc:ucanaccess://C:\Users\vilson_balestero\SerializerTest.mdb;newDatabaseVersion=V2000 login successful
    [EL Warning]: 2014-11-20 17:11:49.658--ServerSession(2070572804)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException
    Internal Exception: net.ucanaccess.jdbc.UcanaccessSQLException: Please, use a simple Statement(and not a PreparedStatement)to execute DDL(e.g.,CREATE TABLE)
    Error Code: 15000
    Call: CREATE TABLE Drawing_Pages (ID INTEGER NOT NULL, Name VARCHAR(255), Number INTEGER, Title VARCHAR(255), PRIMARY KEY (ID))
    Query: DataModifyQuery(sql="CREATE TABLE Drawing_Pages (ID INTEGER NOT NULL, Name VARCHAR(255), Number INTEGER, Title VARCHAR(255), PRIMARY KEY (ID))")

    Please someone can help me?

    NOTE: sorry by my english.

     
  • Marco Amadei

    Marco Amadei - 2014-11-21

    In general, using a PreparedStatement to execute a create table doesn't make sense.
    You can see that the error message is "Please, use a simple Statement(and not a PreparedStatement)to execute DDL(e.g.,CREATE TABLE)".
    Also there was some implementation problem in allowing this.
    Nevertheless, if your ORM executes the DDL using a PreparedStatement, I will review that implementation for the next release.
    Cheers Marco

     
    • Vilson Balestero

      Thanks Marco, I asked about this question to EclipseLink team too.

       
  • Vilson Balestero

    Dear Marco, I tested its latest version v2.0.9.3, and my problem was resolved. Thank you, I appreciate your effort.

     

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.