Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@starrynights89 I'm 100% sure that you can't connect to a server that isn't even running, try the server's host name
-
@beegC0de I think you're right. I checked the url and realized that because I'm running mariadb the sql url shouldn't be there.
jdbc:mariadb://localhost/web_student_tra...
The connection fails as usual but it also says there's a driver conflict, so maybe I need to switch the mysql.jar with a mariadb.jar?
Debugging, the slog we try to avoid but it comes no matter what. -
@starrynights89 yeah I'm not sure how similar the protocols are but you should be using the mariadb one
-
@beegC0de Changed it along with the URL, still getting connection errors.
I may have to double check my sql settings at this rate... -
@starrynights89 can you connect to the server with another client? the mariadb client?
-
OK. PROGRESS.
I changed localhost to my server's IP address, and now I'm just failing to get the client to connect to the server.
It's definitely somewhere in the sql configuration. -
hexc11266yGrats on your solve, wish I came across this thread earlier, would have helped you out. 😕
-
hexc11266yI guess one thing I could contribute is that (provided you are using Tomcat) you can add your db connection cradentials to context.xml in meta-inf directory, this removes the need to load the db driver manually using the 'Class.forName' as well as no longer needing to hardcode your login info. Cleans things up a lot.
-
hexc11266y@starrynights89 typically you wouldn't, I just noticed you were in your original post screenshot. But yeah that looks good! (There are edge cases where you may want to manually load/unload database drivers but it's extremely rare and you may never come across a need to, so for that I say using the context.xml is the way to go)
Related Rants
-
Cyborg15A guy and a girl are in a Java seminar. Afterward, the guy approaches the girl and asks, "Hey gurrl, can I ge...
-
Dacexi24When there are only 2 pages on Google you know you're in serious shit.
-
practiseSafeHex20Fixing a parents iPhone, episode 1. Problem: "Whatsapp is gone off my phone" Debugging: Me: *unlocks phone...
Captains Log:
Day 2 of trying to get SQL database to work with JDBC application.
I've built a try/catch method and it throws up the message that IntelliJ can't find the JDBC driver.
More research to be done. My first officer duck buddy has no input for me.
It's going to be a long day.
rant
sql
debugging
java