• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

Connect REST service to MySQL Docker Container?  RSS feed

 
Bartender
Posts: 1649
17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have two docker containers running fine.

1. a Java REST app.
2. MySQL 8

I can access both externally with no problem.

But, when I try to make the Java REST app talk to the MySQL container, I just get a message that after three tries, there was no connection made.

I've tried various ports, host names, docker-created network name, but JDBC just won't connect.

Here's my docker-compose file:



Some of the failed JDBC connections include these below (miketest_default is the docker-created network name):



----

Any suggestions welcome how to get the Java service in a docker container to be able to reach the MySQL container.

Thanks,

- mike

 
Master Rancher
Posts: 1161
18
Firefox Browser Hibernate IntelliJ IDE Java MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are they on the same host?
This tutorial might help you
 
Mike London
Bartender
Posts: 1649
17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Daniel Demesmaecker wrote:Are they on the same host?
This tutorial might help you



Hi Daniel,

Yes, both containers are running on the same Mac.

Thanks,

- mike
 
I am a man of mystery. Mostly because of this tiny ad:
ScroogeXHTML 8.2 - easy to use RTF to HTML converter library
https://coderanch.com/t/707504/ScroogeXHTML-RTF-HTML-XHTML-converter
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!