Results 1 to 5 of 5
  1. #1
    dpk_vash is offline Member
    Join Date
    Dec 2008
    Location
    Bangalore
    Posts
    4
    Rep Power
    0

    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. java.net.ConnectException. 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:


    java.lang.NullPointerException
    at org.netbeans.modules.hibernate.wizards.support.DBS chemaManager$2.isEnabled(DBSchemaManager.java:127)
    at org.netbeans.modules.j2ee.core.api.support.progres s.ProgressSupport$ActionInvoker.invokeNextActionsO fSameKind(ProgressSupport.java:244)
    at org.netbeans.modules.j2ee.core.api.support.progres s.ProgressSupport$ActionInvoker.invoke(ProgressSup port.java:183)
    at org.netbeans.modules.j2ee.core.api.support.progres s.ProgressSupport.invoke(ProgressSupport.java:109)
    at org.netbeans.modules.hibernate.wizards.support.DBS chemaManager.getSchemaElement(DBSchemaManager.java :220)
    at org.netbeans.modules.hibernate.util.HibernateUtil. getAllDatabaseTablesOnEventThread(HibernateUtil.ja va:160)
    at org.netbeans.modules.hibernate.service.spi.Hiberna teEnvironmentImpl.getAllDatabaseTablesOnEventThrea d(HibernateEnvironmentImpl.java:253)
    at org.netbeans.modules.hibernate.wizards.HibernateMa ppingWizardPanel.fillDatabaseTable(HibernateMappin gWizardPanel.java:106)
    at org.netbeans.modules.hibernate.wizards.HibernateMa ppingWizardPanel.<init>(HibernateMappingWizardPane l.java:88)
    at org.netbeans.modules.hibernate.wizards.HibernateMa ppingWizardDescriptor.getComponent(HibernateMappin gWizardDescriptor.java:74)
    at org.netbeans.modules.hibernate.wizards.HibernateMa ppingWizard.createSteps(HibernateMappingWizard.jav a:297)
    at org.netbeans.modules.hibernate.wizards.HibernateMa ppingWizard.getPanels(HibernateMappingWizard.java: 115)
    at org.netbeans.modules.hibernate.wizards.HibernateMa ppingWizard.current(HibernateMappingWizard.java:27 1)
    at org.openide.loaders.TemplateWizard$InstantiatingIt eratorBridge.current(TemplateWizard.java:980)
    at org.openide.loaders.TemplateWizardIterImpl.current (TemplateWizardIterImpl.java:140)
    at org.openide.loaders.TemplateWizardIteratorWrapper. current(TemplateWizardIteratorWrapper.java:89)
    at org.openide.WizardDescriptor.updateStateOpen(Wizar dDescriptor.java:804)
    at org.openide.WizardDescriptor.updateState(WizardDes criptor.java:801)
    at org.openide.loaders.TemplateWizard.updateState(Tem plateWizard.java:731)
    at org.netbeans.modules.project.ui.NewFileWizard.upda teState(NewFileWizard.java:118)
    at org.openide.WizardDescriptor$Listener.stateChanged (WizardDescriptor.java:1929)
    at org.openide.util.WeakListenerImpl$Change.stateChan ged(WeakListenerImpl.java:319)
    at org.openide.loaders.TemplateWizardIterImpl.fireSta teChanged(TemplateWizardIterImpl.java:270)
    at org.openide.loaders.TemplateWizardIterImpl.setIter ator(TemplateWizardIterImpl.java:116)
    at org.openide.loaders.TemplateWizardIteratorWrapper. setIterator(TemplateWizardIteratorWrapper.java:76)
    at org.openide.loaders.TemplateWizard.setTemplateImpl (TemplateWizard.java:193)
    at org.openide.loaders.TemplateWizard.setTemplate(Tem plateWizard.java:211)
    at org.openide.loaders.TemplateWizard.instantiateImpl (TemplateWizard.java:458)
    at org.openide.loaders.TemplateWizard.instantiate(Tem plateWizard.java:374)
    at org.netbeans.modules.project.ui.actions.NewFile.do Perform(NewFile.java:154)
    at org.netbeans.modules.project.ui.actions.NewFile.ac cess$200(NewFile.java:80)
    at org.netbeans.modules.project.ui.actions.NewFile$Po pupListener.actionPerformed(NewFile.java:349)
    at javax.swing.AbstractButton.fireActionPerformed(Abs tractButton.java:1995)
    at javax.swing.AbstractButton$Handler.actionPerformed (AbstractButton.java:2318)
    at javax.swing.DefaultButtonModel.fireActionPerformed (DefaultButtonModel.java:387)
    at javax.swing.DefaultButtonModel.setPressed(DefaultB uttonModel.java:242)
    at javax.swing.AbstractButton.doClick(AbstractButton. java:357)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Bas icMenuItemUI.java:1220)
    at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mou seReleased(BasicMenuItemUI.java:1261)
    at java.awt.Component.processMouseEvent(Component.jav a:6041)
    at javax.swing.JComponent.processMouseEvent(JComponen t.java:3265)
    at java.awt.Component.processEvent(Component.java:580 6)
    at java.awt.Container.processEvent(Container.java:205 8)
    at java.awt.Component.dispatchEventImpl(Component.jav a:4413)
    at java.awt.Container.dispatchEventImpl(Container.jav a:2116)
    at java.awt.Component.dispatchEvent(Component.java:42 43)
    at java.awt.LightweightDispatcher.retargetMouseEvent( Container.java:4322)
    at java.awt.LightweightDispatcher.processMouseEvent(C ontainer.java:3986)
    at java.awt.LightweightDispatcher.dispatchEvent(Conta iner.java:3916)
    at java.awt.Container.dispatchEventImpl(Container.jav a:2102)
    at java.awt.Window.dispatchEventImpl(Window.java:2440 )
    at java.awt.Component.dispatchEvent(Component.java:42 43)
    [catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java: 599)
    at org.netbeans.core.TimableEventQueue.dispatchEvent( TimableEventQueue.java:104)
    at java.awt.EventDispatchThread.pumpOneEventForFilter s(EventDispatchThread.java:273)
    at java.awt.EventDispatchThread.pumpEventsForFilter(E ventDispatchThread.java:183)
    at java.awt.EventDispatchThread.pumpEventsForHierarch y(EventDispatchThread.java:173)
    at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:168)
    at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:160)
    at java.awt.EventDispatchThread.run(EventDispatchThre ad.java:121)





    Can anybody help me out.. ?

    Thanks in advance.....

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

    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..???
    Thanks

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

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

    Hi,

    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..
    regds,
    mitr
    Last edited by mitr_hamesha; 02-26-2009 at 11:18 AM.

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

    Default

    Hi Dpk,

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

    Thanks,
    Shikha

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

    Default

    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
    com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host has failed.
    and probably you might be able to solve problem.

    -Regards
    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, 01: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
  •