0

My Java Servlet application currently has the database connection parameters hard-coded in the persistence.xml file like this:

<properties>
  <property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/XXX?useEncoding=true&amp;characterEncoding=UTF-8"/>
  <property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>
  <property name="javax.persistence.jdbc.user" value="XXX"/>
  <property name="javax.persistence.jdbc.password" value="XXX"/>
  <property name="eclipselink.ddl-generation" value="create-tables"/>
</properties>

I'd like to move those out to a separate configuration file so that users can change them on their own. What's the way to do that?

2
  • Have you checked this answer? Commented May 1, 2020 at 17:30
  • Thanks @AlexRudenko, will try this out Commented May 2, 2020 at 6:10

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.