0 Replies Latest reply on Oct 12, 2007 5:27 PM by hugovz

    Error Connecting To Database

    hugovz
      Hi,

      I have an error connecting to database using Run>Create Application From Database.

      1) I've installed SQL Server 2005 Express, Visual Studio 2005, and Flex Builder 3 Beta 2
      2) In Flex Builder 3, I created a new Flex Project, selected ASP.NET as Application server type and "Use ASP.NET Development Server"
      3) In Visual Studio 2005 I created a new Asp.NET website by going to:
      File>New>Web Site...
      I selected the Flex project folder and then selected "Create a new Web site in the existing location"
      4) in Visual Studio 2005 I'm able to connect using Visual Studio 2005 Server Explorer menu to the Northwind sample database using the "sa" username and password (SQL Server Authentication)
      5) I then attempted to connect to the database through Flex Builder 3 Beta 2 using Data>Create Application From Database... but I received an error message: "Unable to connect to the database" with the error details listed below.
      6) I'm not sure what to try next. Here are the settings that I used:
      Server Name: localhost
      Database Name: Northwind
      User Name: sa
      Password: <the password>

      Does it matter if testing the ASP.net website from Visual Studio 2005 runs the website on a different port than Flex Builder does??
      Here's the link that Visual Studio 2005 runs the development web server on:

      http://localhost:3022/TestFlexData/Default.aspx

      Here's the port that FlexBuilder runs it on:
      http://localhost:3000/Test/flex_bin/Test.html

      So, does it matter that the ports are different? If so, how do I change them to match. If it doesn't matter, what else could be the issue?


      java.sql.SQLException: Network error IOException: Connection refused: connect
      at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:372)
      at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
      at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:178)
      at org.eclipse.datatools.connectivity.db.generic.JDBCConnection.createConnection(JDBCConnect ion.java:87)
      at org.eclipse.datatools.connectivity.DriverConnectionBase.internalCreateConnection(DriverCo nnectionBase.java:104)
      at org.eclipse.datatools.connectivity.DriverConnectionBase.open(DriverConnectionBase.java:53 )
      at org.eclipse.datatools.connectivity.db.generic.JDBCConnectionFactory.createConnection(JDBC ConnectionFactory.java:52)
      at org.eclipse.datatools.connectivity.internal.ConnectionFactoryProvider.createConnection(Co nnectionFactoryProvider.java:77)
      at org.eclipse.datatools.connectivity.internal.ConnectionProfile.createConnection(Connection Profile.java:354)
      at com.adobe.datatools.derived.wizards.BaseConnectionProfilePage.testConnectionSimple(BaseCo nnectionProfilePage.java:70)
      at com.adobe.datatools.derived.wizards.BaseConnectionProfilePage.testConnection(BaseConnecti onProfilePage.java:51)
      at org.eclipse.datatools.connectivity.ui.wizards.ConnectionProfileDetailsPage$1.widgetSelect ed(ConnectionProfileDetailsPage.java:85)
      at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:227)
      at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
      at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
      at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3682)
      at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3293)
      at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
      at org.eclipse.jface.window.Window.open(Window.java:796)
      at com.adobe.flexbuilder.dbwizard.ui.DbWizard$8.widgetSelected(DbWizard.java:598)
      at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:227)
      at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
      at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
      at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3682)
      at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3293)
      at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
      at org.eclipse.jface.window.Window.open(Window.java:796)
      at com.adobe.flexbuilder.dbwizard.actions.DBWizardAction.run(DBWizardAction.java:69)
      at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:256)
      at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229)
      at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionI tem.java:545)
      at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:490)
      at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java :402)
      at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
      at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
      at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3682)
      at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3293)
      at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
      at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
      at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
      at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
      at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
      at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
      at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
      at com.adobe.flexbuilder.standalone.FlexBuilderApplication.start(FlexBuilderApplication.java :112)
      at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:153)
      at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLau ncher.java:106)
      at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.jav a:76)
      at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
      at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:504)
      at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443)
      at org.eclipse.equinox.launcher.Main.run(Main.java:1169)
      at org.eclipse.equinox.launcher.Main.main(Main.java:1144)
      Caused by: java.net.ConnectException: Connection refused: connect
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.PlainSocketImpl.doConnect(Unknown Source)
      at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
      at java.net.PlainSocketImpl.connect(Unknown Source)
      at java.net.SocksSocketImpl.connect(Unknown Source)
      at java.net.Socket.connect(Unknown Source)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at net.sourceforge.jtds.jdbc.SharedSocket.createSocketForJDBC3(SharedSocket.java:289)
      at net.sourceforge.jtds.jdbc.SharedSocket.<init>(SharedSocket.java:250)
      at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:297)
      ... 57 more