Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8819019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:14:51+00:00 2026-06-14T05:14:51+00:00

I keep getting this error when i’m trying to connect to my MySQL database:

  • 0

I keep getting this error when i’m trying to connect to my MySQL database:

exception

javax.servlet.ServletException: JDBC Problem: 
root cause

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
root cause

java.net.ConnectException: Connection timed out: connect

here’s some code:

Connection con = null;
        Statement stmt = null;
        ResultSet rs = null;
        try{
            Class.forName("com.mysql.jdbc.Driver");
            con = DriverManager.getConnection
                    ("jdbc:mysql://mysql11.000webhost.com/database_name","user_name","password");
        stmt = con.createStatement();
        rs = stmt.executeQuery("INSERT into emailadresses('email') values ('"+email+"')");
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(EmailServlet.class.getName()).log(Level.SEVERE, null, ex);
        }catch(SQLException e){
            throw new ServletException("JDBC Problem: ", e);
        }

edit: I have the mysql-connector-java jar file in my libraries

EDIT: FOUND THE PROBLEM
I was looking for the answer on the site where I host my database and found this:

JDBC/ODBC is not supported here

that s*cks…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T05:14:53+00:00Added an answer on June 14, 2026 at 5:14 am

    “Signals that an error occurred while attempting to connect a socket to a remote address and port. Typically, the connection was refused remotely (e.g., no process is listening on the remote address/port)”. – From Oracle Docs

    Take a look into your connection string, be sure that the database, username and the password are correctly typed.

    Another cause may be that your database server is not up.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Keep getting this error after inserting a subdatasheet into a query and trying to
I keep getting this error with my Play 2.0 application: play.core.ActionInvoker$$anonfun$receive$1$$anon$1: Execution exception [[MatchError:
I keep getting this error mesage when trying to add a breakpoint in gdb.
I keep getting this error when trying to delete a record from my table.
I keep getting this error: MySQL said: #1064 - You have an error in
I keep getting this error: Error: uncaught exception: Syntax error, unrecognized expression: [object Object]
I keep getting this error when trying to configure the upload directory with Apache
I keep getting this error and i have been trying everything for about a
I keep getting this error when trying to do a git pull or a
I keep getting this error when trying to view my channels controller. uninitialized constant

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.