Help! Unable to connect to any hosts

Hi i'm new to jdbc and am having problems when trying to connect to the mysql database (with connectorj), i get the following error:
Unable to connect to any hosts due to exception: java.net.ConnectException Connection refused.
Its looks like the problem is with this line:
Connection connection = DriverManager.getConnection("jdbc:mysql://www.thedom.com/db?user=name&password=pass");
My full source is below:
import java.sql.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;
public class TestDB
     public static void main(String[] arguments)
          TestDB db = new TestDB();
     TestDB()
          try
               Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection connection = DriverManager.getConnection("jdbc:mysql://198.64.146.121/vanljab?user=vanljab&password=WsW6S4WD");
               Statement statement = connection.createStatement();
               ResultSet resultSet = statement.executeQuery(
               "Select * from vanljab.products where 1");
               while (resultSet.next())
               /*     System.out.print(resultSet.getString("name"));
                    System.out.print(" ");
                    System.out.print(resultSet.getString("time"));
                    System.out.print(" ");
                    System.out.print(resultSet.getString("date"));
                    System.out.print(" ");
                    System.out.print(resultSet.getString("num_of_people"));
                    System.out.println();
               statement.close();
               connection.close();
          catch (SQLException sqlException)
               System.out.println("SQL: " + sqlException.getMessage());
          catch (ClassNotFoundException classNotFoundException)
               System.out.println("Driver not right: " +
               classNotFoundException.getMessage());
          catch (Exception instantiationException)
               System.out.println("Instantiation error: " +
               instantiationException.getMessage());

found the problem, needed to change this line
Connection connection = DriverManager.getConnection("jdbc:mysql://www.thedom.com/db?user=name&password=pass");
to this adding mysql to the domain name
Connection connection = DriverManager.getConnection("jdbc:mysql://mysql.thedom.com/db?user=name&password=pass");

Similar Messages

  • ERROR: Unable to connect to any of the specified MySQL hosts.

    Hi all, 
    I have run into an issue and not able to resolve it. 
    There was a requirement to connecting to a MySQL data source. For that I unknowingly added an entry in the "ODBC Data Source Administrator" ->
    User DSN & System DSN 
    I was totally unaware that I am breaking my SP setup (Development). Now Central Admin site and all other sites have stopped working. 
    I tried repairing by re-running the config wizard but no use. Error I get is "An unexpected error has occurred." OR "Unable to connect to any of the specified MySQL hosts." 
    But when I try accessing other site, its showing an error from the "machine.config" file: >
    Line 284: <siteMap>
    Line 285: <providers>
    Line 286: <add name="MySqlSiteMapProvider" type="MySql.Web.SiteMap.MySqlSiteMapProvider, MySql.Web, Version=6.9.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionStringName="LocalMySqlServer" applicationName="/" />
    Line 287: </providers>
    Line 288: </siteMap>
    Source File: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config 
    For record, I have already removed those entries from that User DSN & System DSN.
    Still error persists. 
    If some has ANY IDEA how to resolve it... please help! 
    Regards, Nayan

    Can you give us a description of what is happening? Errors form the Application and System Event Log, and/or ULS logs?
    Trevor Seward
    Follow or contact me at...
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • An automated update has rendered my laptop Firefox browser unable to connect to any websites, how do I fix this issue?

    When the update for my browser took place, on 5/5/14 @ approximately 12:15 am, it rendered the browser unable to connect to any websites. It does work in safe mode, but not in regular mode. I am on an hp pavilion dv7, running windows 7. I need to resolve this issue ASAP. Or I will have to switch browsers, which I don't want to do, as I have used Firefox for many years. Can I get some assistance to rectify the problem?

    Can you start by giving us the troubleshooting information from the Firefox installation that's having problems. This is an essential step in troubleshooting.<br>
    *Click the Firefox button at the top left, then click the ''Help'' menu and select ''Troubleshooting Information'' from the sub-menu. If you don't have a Firefox button, click the Help menu at the top and select ''Troubleshooting Information'' from the menu.
    Now, a new tab containing your troubleshooting information should open.
    *At the top of the page, you should see a button that says "Copy text to clipboard". Click it.
    *Now, go back to your forum post and click inside the reply box. Press Ctrl+V to paste all the information you copied into the forum post.

  • Unable to connect to any wireless internet

    laptop not supported any dongal to connect internet where as device connected other laptop. If i connect with Hot s[pot then its connected so request you to help on this & suggest what should i do.  shoud i format ?

    Hello @James0007,
    Welcome to the HP Forums, I hope you enjoy your experience! To help you get the most out of the HP Forums I would like to direct your attention to the HP Forums Guide First Time Here? Learn How to Post and More.
    I have read your post on how your notebook computer is unable to connect to any wireless network. I would be happy to help you, but first I would encourage you to post your product number for your computer. Below is a is an HP Support document that will demonstrate how to find your computer's product number. In addition, it will also help if you indicate which operating system you are using; and whether your operating system is 32 or 64 bit. The more information you can provide, the better!
    How Do I Find My Model Number or Product Number?
    Which Windows operating system am I running?
    Is the Windows Version on My Computer 32-bit or 64-bit?
    Please re-post with the necessary information, this way I will be able to research this further for you. I look forward to your reply!
    Cheers!  
    MechPilot
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the right to say “Thanks” for helping!

  • Why can't I update or load new apps on my iPhone and iPad. It does not ask me for my password. I tried to sync from my laptop now I am unable to connect to any sites from internet explorer. When I try to update or load any app it tells me it is corrupt

    Why can't I update or load new apps on my iPhone and iPad. It does not ask me for my password. I tried to sync from my laptop now I am unable to connect to any sites from internet explorer. When I try to update or load any app it tells me it is corrupt

    You need to ask Apple for assistance with getting back into your old ID. To do this, click here and pick a method; if that page doesn't list one for your country or you're unable to resolve this issue through the Account Security team, fill out and submit this form.
    (118441)

  • I'm unable to connect to any AOL servers using Mail.  Other computers, iPhone, iPad all connect successfully.

    Hello everyone,
         I have been working with AOL for about three months now with no end in sight.  I purchased a MacBook Pro in late September and attempted to use Mail (later Outlook with the same results) to download my Gmail and AOL email.  I confirmed all the settings were correct for both accounts and began downloading email.  Once completed, I noticed only my Gmail had downloaded and AOL stated it was unable to connect to any of the servers.  I engaged AOL and they've been making me try random ports, deleting profiles, etc.  Nothing was worked.
         I am looking here in hopes someone knows something since I'm able to access AOL email via the web, using my iPhone's Mail app, my iPad's mail app, and two of my Windows laptops.  Only my MacBook Pro with Retina Display (Mid-2012) has issues.  I'm running Mountain Lion 10.8.2 with all updates.
         Tried using telnet but get "connection refused".  No firewalls are running.  I thought maybe it was the OS itself so I installed Office 2010 on Windows 7 in Fusion and Outlook gives me "an encrypted connection to your mail server is not available".  This is a clean install with no firewalls, AV, nothing.
    In both Windows on Fusion and my Mountain Lion, Outlook and Mail successfully connect to Gmail's IMAP servers but fail to connect to AOL's POP or IMAP servers.
    Any ideas?
    Thank you in advance.

    Thanks for this.
    Before I see your suggestion, I did it below that worked well:
    - SIgn off the Mac App store (if you were signed in with another Apple ID)
    - Leave the Mac App store open
    - Quit iTunes and iBooks if they are running
    - Open Safari, and go to Preferences/Privacy
    - Choose to block cookies "Always"
    - Click on "details" under "Remove all website data ..."
    - Search for apple.com; select the "apple.com" line then click "Remove", then click "Done"
    - Quit Safari
    - Open Activity Monitor (search for it using Spotlight or find it in the Applications/Utilities folder)
    - In Activity Monitor, search for "storeagent". You should find "storeagent" and possibly "ibookstoreagent"
    - Select each of them and force quit them (using the X in the toolbar if you are using Mavericks)
    - In the Finder, go to the ~/Library/Cookies folder (go to ~/Library using the "Go" menu while pressing Alt then open the Cookies folder)
    - Delete   "com.apple.appstore.cookies"   and empty the trash.
    - Go to the Mac App Store and sign in. This should work. You can press Esc if asked for your username and password a second time.
    - Go to Safari, then Preferences/Privacy
    - Choose to block cookies "from third parties and advertisers"
    - Go back to the Mac App Store. You should be able to use it "normally".
    Some steps might be overkill, but it seems to work for me now.
    Anyway, thanks!!

  • Unable to connect to any secure sites with any browser

    I am unable to connect to any secure sites. I downloaded Firefox with the hopes that it would fix the problem but it did not. What ever browser I use I cant connect to any secure sites. All of the other pages load correctly.
    I have a PC notebook that I tried to load the same sites it worked fine, so I know that it is not a connecting problem.
    emac Mac OS X (10.4.6)
    ibook   Mac OS X (10.2.x)  

    Are you connecting via dial up or high speed through a router? If that latter, check the firewall settings of the router. I have my router set to medium (high, medium, low, & none) and it works most of the time. But occationally I get to sites that won't load and setting the router (temporarily) to low usually allows me to access those sites. So perhaps this is your issue.
    I think there are ways to add those sites to router security lists or "services" that will now let them through with the higher security settings, but I need it so rarely I haven't bothered to figure it out yet.
    Patrick

  • Unable to connect to any ACS View Server.

    I cannot read ACS 5.3 logs from my WCS. I have the ACS server added to the WCS. Below is the message I'm getting:
    Unable to connect to any ACS View  Server.Failed to access the WSDL at:  https://10.10.10.90:443/ACSViewWebServices/ACSViewWebServices?wsdl. It  failed with:       https://10.10.10.90:443/ACSViewWebServices/ACSViewWebServices?wsdl.
    Any ideas? Do I need to install any special module on the ACS to support this?!

    I realize this is a very old thread but the answer to this is to enable the web service on your ACS logging server.
    Login to the CLI and issue the command "acs config web-interface view enable"
    http://www.cisco.com/en/US/docs/net_mgmt/cisco_secure_access_control_system/5.1/sdk/mrvapis.html

  • HT4623 unable to connect to any wifi

    unable to connect to any wifi

    Did you already follow the troubleshooting in these articles?
    iOS: Troubleshooting Wi-Fi networks and connections
    iOS: Wi-Fi or Bluetooth settings grayed out or dim
    Wi-Fi: Unable to connect to an 802.11n Wi-Fi network
    iOS: Recommended settings for Wi-Fi routers and access points

  • I am unable to connect to IPP host. Would someone tell me the steps to get this to happen for me?

    I am unable to connect to IPP host, and therefore cannot print

    fyi:
    IPP (Internet printing protocol)
    IPP is a relatively new (1999) protocol  based on the HTTP protocol. With IPP, more job-related data is transmitted than in the other protocols.       CUPS uses IPP for internal data transmission. This is the preferred protocol for a forwarding queue between two CUPS servers.  The name of the print queue is necessary to configure IPP correctly.
    The port number for IPP is 631.     
    http://www-uxsup.csx.cam.ac.uk/pub/doc/suse/suse9.2/suselinux-adminguide_en/ch12 s04.html
    This thread, suggest by the new forum software! has some interesting info:
    https://discussions.apple.com/message/13100324#13100324

  • Unable to connect to local host

    Hi,
    I have 64 bit operating system and got installed SQL Server Management Studio of 64 bit and the problem I am facing is unable to connect to local host, I have database mdf/ldf files in my local system and unable to connect to local system
    tried localname/SQLEXPRESS and it did not work.

     SQL Server Management Studio is not enough, you also need to install SQL Server instance.
    http://www.orcsweb.com/blog/mark-newnam/how-to-install-sql-server-2012-express-edition/
    Keerthi Deep | Blog SQLServerF1 |
    Facebook

  • TS1398 Can't connect to hotspot with my iPad, picks it up but unable to connect. Any sugestions?

    Can't connect to hotspot with my iPad, picks it up but unable to connect. Any sugestions?

    When Access Connections fails to connect it asks if I want to configure the network and there's a bunch of settings. Connection type: infrastructure or Adhoc, Wireless security type "use static WEP keys", "Use Wi-Fi protected Access - Pre Shared Key (WPA-PSK)" - I choose it and under Properties there's more options. Access point authentication, WPA-PSK or WPA2-PSK; I've tried it both ways. Data encryption: TKIP or AES, I've been using TKIP. Under Pre-Shared Key, there's the only box I see to enter a password, so I enter the password there.
    Chances are pretty good that the problem is the network configuration of your PC and not the AirPort Extreme Base Station (AEBS). What configuration options you choose will depend on how you set up the AEBS's wireless network, but the following can be used as a guideline:
    o Connection Type: Infrastructure
    o Wireless Security Type:
    AirPort Setting = PC Setting
    o WEP = WEP
    o WPA Personal = WPA-PSK w/TKIP
    o WPA2 Personal = WPA-PSK w/AES

  • Integration with JMS Weblogic server, Couldn't connect to any host

    Hi ,
    I am doing XI to JMS integration(weblogic JMS server) ,have created a communication channel of type JMS and gave the following parameters.
    Transport Protocal  : Access JMS Provider with JNDI
    Message protocal    : JMS 1.X
    JNDI Lookup name with
    queueconnectionfactory :MyJMSConnectionFactory
    JNDI Lookup name with JMS Queue : MyJMSQueue
    Name of JNDI initial context factory : weblogic.jndi.WLInitialContextFactory
    <b>JNDI Server Address: http://isccap:7001/</b>
    all these parameters are working fine when used in a Client java program by which i am able to put and retrive message from Weblogic JMS server queue.
    But the same is not working in XI adapter ,
    I am getting the following error in adapter monitoring
    Zsrl_JMS_Reciever Receiver channel. Details: <u>Couldn't connect to any host</u>
    I guess the problem is with <b>JNDI Server Address: http://isccap:7001/</b>
    Is the format "http://host:port"  correct for weblogic server,
    are the JMS port and JNDI port same or different .
    I have deployed the required drivers "wlclient.jar" in XI server .
    Thanks in advance ,
    srikanth Lanka

    weblogic works on the Tenga3 protocol and hence the URL to connect to the JNDI provider of weblogic is
    t3://host:port
    At least in case of Weblogic you connect to your J2EE resources using your JNDI registry so the port would be the same.
    Rgds,
    Amol

  • Firefox is "unable to connect" to any site, while other broswers can

    I've tried clearing my cookies and history, disabling addons/extensions and the firewall, changing/disabling proxy settings, and read several of the articles, but nothing seems to work. I was out of town for 2 days and everything was working fine when I left. Got back today and just kept getting "unable to connect" message for any website I tried to open. I tried to download chrome and opera, but the download had an error and just didn't work (chrome) and just stayed at 0% with nothing happening (opera). i'm able to get emails and get on websites via internet explorer.

    Hello vtand06, did you also try a ''Clean reinstall'' ? This means you remove Firefox program files and then reinstall Firefox. Please follow these steps:
    '''Note:''' You might want to print these steps or view them in another browser.
    #Download the latest Desktop version of Firefox from [https://www.mozilla.org mozilla.org] (or choose the download for your operating system and language from [https://www.mozilla.org/firefox/all/ this page]) and save the setup file to your computer.
    #After the download finishes, close all Firefox windows (or open the Firefox menu [[Image:New Fx Menu]] and click the close button [[Image:Close 29]]).
    #Delete the Firefox installation folder, which is located in one of these locations, by default:
    #*'''Windows:'''
    #**C:\Program Files\Mozilla Firefox
    #**C:\Program Files (x86)\Mozilla Firefox
    #*'''Mac:''' Delete Firefox from the Applications folder.
    #*'''Linux:''' If you installed Firefox with the distro-based package manager, you should use the same way to uninstall it - see [[Installing Firefox on Linux]]. If you downloaded and installed the binary package from the [http://www.mozilla.org/firefox#desktop Firefox download page], simply remove the folder ''firefox'' in your home directory.
    #Now, go ahead and reinstall Firefox:
    ##Double-click the downloaded installation file and go through the steps of the installation wizard.
    ##Once the wizard is finished, choose to directly open Firefox after clicking the Finish button.
    More information about reinstalling Firefox can be found [[Troubleshoot and diagnose Firefox problems#w_5-reinstall-firefox|here]].
    <b>WARNING:</b> Do not use a third party uninstaller as part of this process. Doing so could permanently delete your [[Profiles|Firefox profile]] data, including but not limited to, extensions, cache, cookies, bookmarks, personal settings and saved passwords. <u>These cannot be easily recovered unless they have been backed up to an external device!</u> See [[Back up and restore information in Firefox profiles]]. <!-- Starting in Firefox 31, the Firefox uninstaller no longer lets you remove user profile data.Ref: Bug 432017 and https://support.mozilla.org/kb/uninstall-firefox-from-your-computer/discuss/5279 [Fx31] Windows uninstaller will no longer offer the option to remove personal data -->
    Please report back to say if this helped you!
    Thank you.

  • My ipad2 was working fine last night, but this morning is unable to connect to ANY wifi networks (though it can detect them).  All typical solutions fail.  What can i do?

    My ipad2 was working fine last night, but this morning when I woke it up... it no longer was connected to my network.  While it can detect networks, it cannot connect to any (have tried at home and at work).  I have tried: resetting router, resetting ipad, forgetting network, renewing lease on network, ensuring airplane mode is off, resetting network settings, turning wifi on/off.  None of the typical solutions I can find online seem to work.  HELP!

    You've gone through all of the basics. You might look at this document regarding potential issues with wi-fi environments. 
    http://support.apple.com/kb/HT4199
    If none of that works, and if a device restore doesn't work, it's time for a trip to the Genius Bar. 

Maybe you are looking for

  • How do i stop two charges to my credit card

    how do i stop two charges to my credit card done in itunes store

  • Connection issue with iPod Shuffle 4th Gen.

    Hello, I have problem with my iPod Shuffle 4th gen. One day i tried as always to turn it on and listen music but i heard only short "info" sound and saw short green diode impulse and nothing else. My computer (windows 7) also can't find it, after plu

  • Number range creation for new service order type

    Hi, Could anyone please tell me how can we create service order number range if we have done a new service order type creation, and what should we do: should we create the number range in development and then transport it to the production or we shou

  • Formula variable in condition

    Hello gurus, I have a requirement where i need to provide the selection option in the variable screen for the key figure. for this i hav created the fomula variable of type user entry at the condition level. I am getting the variable  in the selectio

  • Can I fax a pdf file from pc through HP 5610 usb connection?

    My old XP pc had a telephone/fax modem that allowed me to send out papaerless documents as faxes. My new Win 8.1  desktop has no such hardware. I found a 5610 All-in one at the thrift store. Can I direct files through the usb port to be sent as faxes