Can I put my persistence.xml
in any folder on my hard-drive and can access to it with my Java SE application?
Is there any solutions for my problem?
Can I put my persistence.xml
in any folder on my hard-drive and can access to it with my Java SE application?
Is there any solutions for my problem?
persistence.xml must be present under META-INF in the CLASSPATH of the running application. That is the only restriction. You could easily enough include some other location in the CLASSPATH and have your persistence.xml there as long as it was in a folder META-INF.
Some JPA providers allow you to just specify the location as a persistence property, doing away with the META-INF requirement, but then that is not covered by the JPA spec so not portable