This week's book giveaway is in the Go forum.
We're giving away four copies of Head First Go and have Jay McGavren on-line!
See this thread for details.
Win a copy of Head First Go this week in the Go 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
  • 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

Problem with jdbc mysql public connection to database  RSS feed

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on a small project but very important one for school, and I want to link my public database to the software using jdbc. I am getting connection error to the database!

I have started my project in localhost and it worked just fine.

PS: I am using, also, mysql-connector-java-8.0.15.jar and Hibernate.

I am using this method for the connection:



I can't show you the host ofc but I'll provide the format that I used and I am sure that it is the correct format.


I am excepting a normal connection to the database but, unfortunately, I can't!
 
Sheriff
Posts: 5750
149
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whenever you say, "I got an error," be sure to post the full error message and stack trace if any.
 
Bartender
Posts: 1649
17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to post additional information.

Did you try to step through your JDBC code in the debugger?

I would also try creating a simple database locally for testing. Make sure you can connect to that first.


- mike
 
Saloon Keeper
Posts: 20514
115
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, get rid of the Class.forName() line. It's long obsolete.
 
Would you like to try a free sample? Today we are featuring tiny ads:
Become a Java guru with IntelliJ IDEA
https://www.jetbrains.com/idea/
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!