0

I've developed a client porgram which needs to establish a connection to a mysql database. Up to now i use the jdbc for this. However, the company gave me the restriction to only use either the port 80 or 8080.

My question now is, if it is possible to use jdbc and force the client somehow to use one of these ports or can anyone name a better framework/ way on how to connect with only one of these ports?

edit: First of all, thank you for the fast answers, but I think I may have asked on a way which does not generate the answer I need. To clarify myself, I do not need to get the mySQL-Server to listen to the ports 80 / 8080. The serverside is fine with the default port. I need to force the client to access the internet with either port 80 or 8080.

Raevar
  • 3
  • 2
  • Either mysql needs to be configured to run on 80/8080 or it needs to be hosted on a cloud provider which will give you api endpoints to access database (port 80). However, you need to ensure no other service is using the port that mysql runs on or else the constraint of 80/8080 are impossible to satisfy. For changing port: https://stackoverflow.com/questions/29866204/how-to-change-the-default-port-of-mysql-from-3306-to-3360 – Nikhil Sahu Mar 28 '19 at 16:35

1 Answers1

1

You can specify the port just after the host in the JDBC URL. F. ex. jdbc:mysql://localhost:8080/test

Carl Düvel
  • 1,029
  • 9
  • 17
  • thank you for your answer, but this was not what i am looking for. The serverside is set and ready (jdbc:mysql://ip:3306/test), but the clientside needs to access the internet over one of these ports. Do you know how i am able to perform this? – Raevar Mar 29 '19 at 15:57