vyurik (74) [Avatar] Offline
Hi Ken,
Since I am interested in running effective microservices integration test, I wrote a small application similar to the admin app of Chapter 8.The data model is aroung a Product Entity that is simpler to your Category entity.
1. First, I was running against embedded H2 like admin app of Chapter 8 with Admin DS. With this simple Product Entity I had a problem org.h2.jdbc.JdbcSQLException: Data conversion error converting first record in load.sql to the product table.
I attached a document describing details of this process.
2. I tried unsuccessfully to create my own datasource java:/jboss/datasources/ProductDS instead of using AdminDS, but could not find reliable documentation on how to create a DS with Wildfly-Swarm.
3. Since in-memory databases are never used in production, I wanted to try to use H2 standalone and MySQL running on my PC. Although I found this piece of info https://howto.wildfly-swarm.io/create-a-datasource/, all it talked was about in-memory H2.
There is also this piece of info: https://github.com/wildfly-swarm/wildfly-swarm-examples/blob/master/datasource/datasource-war/src/main/resources/project-mysql.yaml related to MySQL but it didn't work for me.
I think it's important to present (probably in Addendum) workinng examples of standalone databases and drivers configuration with Wildfly-Swarm.

Ken Finnigan (16) [Avatar] Offline

Thanks for the input.

I'm presently going through and updating a bunch of examples, some of which are for Chapter 10, that show how to configure WF Swarm to connect to an external MySQL database.

In addition, http://docs.wildfly-swarm.io/2018.2.0/#configuring-a-datasource should cover what you need to configure a DataSource. Although the example uses "h2", you can replace it with "mysql" and provide a MySQL JDBC driver as a dependency of your project.

If you don't think the documentation is clear enough as to how that should work, please raise an issue at https://issues.jboss.org/browse/SWARM

vyurik (74) [Avatar] Offline
Hi Ken,
Thanks for your reply.