Results 1 to 5 of 5
  1. #1
    dpk_vash is offline Member
    Join Date
    Dec 2008
    Rep Power

    Default Netbeans 6.5 unable to connect MS SQL Server 2005 Express

    Hi all,

    Could any one help me.. to find out the solution for the error...?

    Description of the problem:

    IDE: Netbeans 6.5

    Framework Hibernate:3.2.5

    Problems Faced:
    Step 1. Start NetBeans.
    Open Services.
    Right click on Database.
    Click new connection.
    Do the entries: According to the database exists in SQL SERVER 2005. Like: Driver name:MS SQL Server 2005
    host: localhost
    database: abc
    user: zyx
    password: ******
    Click OK.

    Problem 1: First I am going to make new connection with Database: MS SQL Server 2005 Express, through sqljdbc dirver 1.2. It wasn't be connected earlier.
    SQL Server is running.

    It gave an Exception "The TCP/IP connection to the host is failed. Connection refused."

    Now, I open SQL Server 2005 Configuration Manager and there I open SQL Server Network Configuration>protocols for SQLEXPRESS>TCP/IP(right click) Properties>IP Addresses tab> IPAll> TCP Port:1433(changed)> apply and ok.

    Restart the SQL SERVER 2005.

    Now I do the same step 1. Now, I got the connection but after getting connection in the services window in NetBeans 6.5 , I am not able to explore the database I connected. Like there I can see table, views, procedures.

    There are no. of tables I have made in the SQL Server 2005 in the same database I had connected, but these are not being explored in this.

    Problem 2:

    Now when I want to do configure the hibernate.cfg.xml file. It is configured but when I go for making .hbm.xml file for the mapping the table to java class file it shows an exception list as follows:

    at chemaManager$2.isEnabled(
    at s.ProgressSupport$ActionInvoker.invokeNextActionsO fSameKind(
    at s.ProgressSupport$ActionInvoker.invoke(ProgressSup
    at s.ProgressSupport.invoke(
    at chemaManager.getSchemaElement( :220)
    at org.netbeans.modules.hibernate.util.HibernateUtil. getAllDatabaseTablesOnEventThread(HibernateUtil.ja va:160)
    at org.netbeans.modules.hibernate.service.spi.Hiberna teEnvironmentImpl.getAllDatabaseTablesOnEventThrea d(
    at org.netbeans.modules.hibernate.wizards.HibernateMa ppingWizardPanel.fillDatabaseTable(HibernateMappin
    at org.netbeans.modules.hibernate.wizards.HibernateMa ppingWizardPanel.<init>(HibernateMappingWizardPane
    at org.netbeans.modules.hibernate.wizards.HibernateMa ppingWizardDescriptor.getComponent(HibernateMappin
    at org.netbeans.modules.hibernate.wizards.HibernateMa ppingWizard.createSteps(HibernateMappingWizard.jav a:297)
    at org.netbeans.modules.hibernate.wizards.HibernateMa ppingWizard.getPanels( 115)
    at org.netbeans.modules.hibernate.wizards.HibernateMa ppingWizard.current( 1)
    at org.openide.loaders.TemplateWizard$InstantiatingIt eratorBridge.current(
    at org.openide.loaders.TemplateWizardIterImpl.current (
    at org.openide.loaders.TemplateWizardIteratorWrapper. current(
    at org.openide.WizardDescriptor.updateStateOpen(Wizar
    at org.openide.WizardDescriptor.updateState(WizardDes
    at org.openide.loaders.TemplateWizard.updateState(Tem
    at org.netbeans.modules.project.ui.NewFileWizard.upda teState(
    at org.openide.WizardDescriptor$Listener.stateChanged (
    at org.openide.util.WeakListenerImpl$Change.stateChan ged(
    at org.openide.loaders.TemplateWizardIterImpl.fireSta teChanged(
    at org.openide.loaders.TemplateWizardIterImpl.setIter ator(
    at org.openide.loaders.TemplateWizardIteratorWrapper. setIterator(
    at org.openide.loaders.TemplateWizard.setTemplateImpl (
    at org.openide.loaders.TemplateWizard.setTemplate(Tem
    at org.openide.loaders.TemplateWizard.instantiateImpl (
    at org.openide.loaders.TemplateWizard.instantiate(Tem
    at Perform(
    at cess$200(
    at org.netbeans.modules.project.ui.actions.NewFile$Po pupListener.actionPerformed(
    at javax.swing.AbstractButton.fireActionPerformed(Abs
    at javax.swing.AbstractButton$Handler.actionPerformed (
    at javax.swing.DefaultButtonModel.fireActionPerformed (
    at javax.swing.DefaultButtonModel.setPressed(DefaultB
    at javax.swing.AbstractButton.doClick(AbstractButton. java:357)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Bas
    at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mou seReleased(
    at java.awt.Component.processMouseEvent(Component.jav a:6041)
    at javax.swing.JComponent.processMouseEvent(JComponen
    at java.awt.Component.processEvent( 6)
    at java.awt.Container.processEvent( 8)
    at java.awt.Component.dispatchEventImpl(Component.jav a:4413)
    at java.awt.Container.dispatchEventImpl(Container.jav a:2116)
    at java.awt.Component.dispatchEvent( 43)
    at java.awt.LightweightDispatcher.retargetMouseEvent(
    at java.awt.LightweightDispatcher.processMouseEvent(C
    at java.awt.LightweightDispatcher.dispatchEvent(Conta
    at java.awt.Container.dispatchEventImpl(Container.jav a:2102)
    at java.awt.Window.dispatchEventImpl( )
    at java.awt.Component.dispatchEvent( 43)
    [catch] at java.awt.EventQueue.dispatchEvent( 599)
    at org.netbeans.core.TimableEventQueue.dispatchEvent(
    at java.awt.EventDispatchThread.pumpOneEventForFilter s(
    at java.awt.EventDispatchThread.pumpEventsForFilter(E
    at java.awt.EventDispatchThread.pumpEventsForHierarch y(
    at java.awt.EventDispatchThread.pumpEvents(EventDispa
    at java.awt.EventDispatchThread.pumpEvents(EventDispa

    Can anybody help me out.. ?

    Thanks in advance.....

  2. #2
    sabhishek is offline Member
    Join Date
    Dec 2008
    Rep Power

    Default Hello Deepak

    Well...your problem is very genuine, since i also hav been through this problem...
    and couldn't get any solution yet...

    can any one is there to solve this out..???

  3. #3
    mitr_hamesha is offline Member
    Join Date
    Feb 2009
    Rep Power

    Default Any idea whether you have given the port number???


    I am able to connect using the same driver.. if you are using netbeans 6.5 and get the use hibernate to connect to the database, you will get the result.

    lemme know..
    Last edited by mitr_hamesha; 02-26-2009 at 12:18 PM.

  4. #4
    shikha07 is offline Member
    Join Date
    Sep 2010
    Rep Power


    Hi Dpk,

    Can you please send me the link from where you downloaded the Netbeans IDE 6.5?


  5. #5
    Prajin's Avatar
    Prajin is offline Senior Member
    Join Date
    Jun 2010
    Ktm, Nepal
    Rep Power


    Connection refused could means:
    1.trying to connect on a port where there is no listener.
    2.Is sql server running and has the correct port configured

    And yeah

    Visit the follow link
    SQLServerException: TCP/IP connection to the host has failed. [Solved] (JDBC forum at JavaRanch)
    and The TCP/IP connection to the host has failed.
    and probably you might be able to solve problem.

    Last edited by Prajin; 09-07-2010 at 06:51 AM. Reason: :-)

Similar Threads

  1. I m unable to connect one frame 2 the other
    By ankitraghuvanshi in forum NetBeans
    Replies: 2
    Last Post: 10-23-2008, 02:24 AM
  2. hibernate support for sql-server 2005
    By javadev in forum JDBC
    Replies: 2
    Last Post: 06-25-2008, 01:48 PM
  3. Replies: 3
    Last Post: 11-03-2007, 02:58 PM
  4. SQL Server 2005 Jdbc connection
    By mgt83 in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 07-27-2007, 04:52 AM
  5. Replies: 1
    Last Post: 07-23-2007, 11:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts