Java, JPA, Glassfish, Invalid resource : jdbc/__default__pm

后端 未结 8 936
不知归路
不知归路 2020-12-02 17:32

I use Glassfish 3.1.2.2 (build 5), JPA, EclipseLink, MySQL

I created MySQL pool via Glassfish admin panel. Ping to MySQL from GF admin panel is ok.

I created

8条回答
  •  抹茶落季
    2020-12-02 17:40

    (The same post of mine but with proper account now):

    When configuring persistence with your setup, you only set the JNDI name for the JDBC pool in persistence.xml. Optional, you may set the target database name.

    
        jdbc/mysql
        
        
    
    

    I also encourage to change the 'drop-and-create-table' to 'create-tables', so that you don't loose data, and this should be be providing EclipseLink's properties in following way:

    
    

    and also handy

    
    

    that will create schema and sql scripts.

    For more information visit: http://wiki.eclipse.org/EclipseLink/Examples/JPA/DDL or http://docs.oracle.com/cd/E19798-01/821-1752/gbwmj/index.html

提交回复
热议问题