This week's book giveaway is in the Beginning Java forum.
We're giving away four copies of Get Programming with Java (MEAP only) and have Peggy Fisher on-line!
See this thread for details.
Win a copy of Get Programming with Java (MEAP only) this week in the Beginning Java forum!
  • 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
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Connect REST service to MySQL Docker Container?  RSS feed

 
Ranch Hand
Posts: 1616
13
  • 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: 933
17
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
Ranch Hand
Posts: 1616
13
  • 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
 
It's hard to fight evil. The little things, like a nice sandwich, really helps. Right tiny ad?
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!