

This feature has been marked as deprecated within JBoss / Wildfly for quite a while now, but it still functions as of today with Wildfly 15.0.1.

Not every project will want to define their data source or deploy their own JDBC drivers, but in some cases, it might make sense.

NOTE: I also had to change Todo.java to have the following line in place of the = GenerationType.IDENTITY) Now we can test it out using our AngularJS project we wrote a while ago. Build it and test it outĪt this point we should be able to package this project and deploy it to Wildfly:Ĭopy /Y target\todo.war \standalone\deployments If you’re curious about anything else, please refer to my previous article about this data source file which goes into more detail. You will want to update the connection-url, user-name, and password fields to match your local installation. Jdbc:mysql://10.0.0.128:3306/todo?allowPublicKeyRetrieval=true&useSSL=false&serverTimezone=UTC Inside this file, you’ll need to add the following: Wildfly will look for filenames with this format and process them. Create a new file that ends with “-ds.xml” (example: “my-ds.xml”). We now need to create our data source configuration file inside of the newly created WEB-INF folder. So your folder structure should now look like:

Now for the last code change, let’s add a new folder structure under “main”, “webapp/WEB-INF”. We’ll revisit the idea of schema management in a future article soon. I’d rather not have Hibernate try to update or create any tables for us. Remove that entry so the properties node has nothing inside: Inside of it there is a “properties” node with one entry. Just below that, let’s add some new properties:Īnother change I’d like to make is to the existing persistence.xml file. The “build” block should now look like this: We can also eliminate the entire “plugins” block within the “build” node, as it isn’t needed anymore. Next, we need to add MySQL’s JDBC driver to our list of dependencies. If you don’t have it already, clone the original JavaEE series GitHub project. This will allow us to seamlessly upgrade versions of Wildfly without having to install JDBC drivers every time we upgrade. To kick things off, we’re going to follow a previous article I wrote and add our JDBC drivers and data source configuration to our war file that we’ll deploy to Wildfly. I’d like to revisit and expand upon that. A while ago, I created a series of articles that created a simple “todo” JavaEE service.
