I am trying to run the derby network server on one machine and trying to
access the database on that machine from another machine.

just for testing purposes,on the client program i give the IP address of the
server machine(found out by going to findmyip.com).

When i try to connect using DriverManager.getconnection(URL),it gives me the
following stacktrace:

Cannot load Databasejava.sql.SQLNonTransientConnectionException:
java.net.ConnectException : Error connecting to server 59.96.37.195 on port
1527 with message Connection refused: connect.
java.sql.SQLNonTransientConnectionException: java.net.ConnectException :
Error connecting to server 59.96.37.195 on port 1527 with message Connection
refused: connect.
        at 
org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown
Source)
        at org.apache.derby.client.am.SqlException.getSQLException(Unknown 
Source)
        at org.apache.derby.jdbc.ClientDriver.connect(Unknown Source)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at GUIModules.DataBaseClass.createConnection(DataBaseClass.java:31)
        at
GUIModules.GeneralLoginGUIClass$2.widgetSelected(GeneralLoginGUIClass.java:104)
        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 GUIModules.ShellClass.eventloop(ShellClass.java:53)
        at
GUIModules.GeneralLoginEventLoop.generalloginshelleventloop(GeneralLoginEventLoop.java:28)
        at GUIModules.DefaultMain.main(DefaultMain.java:11)
Caused by: org.apache.derby.client.am.DisconnectException:
java.net.ConnectException : Error connecting to server 59.96.37.195 on port
1527 with message Connection refused: connect.
        at org.apache.derby.client.net.NetAgent.<init>(Unknown Source)
        at org.apache.derby.client.net.NetConnection.newAgent_(Unknown Source)
        at org.apache.derby.client.am.Connection.<init>(Unknown Source)
        at org.apache.derby.client.net.NetConnection.<init>(Unknown Source)
        at org.apache.derby.client.net.NetConnection40.<init>(Unknown Source)
        at
org.apache.derby.client.net.ClientJDBCObjectFactoryImpl40.newNetConnection(Unknown
Source)
        ... 13 more
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 java.net.Socket.connect(Unknown Source)
        at java.net.Socket.<init>(Unknown Source)
        at java.net.Socket.<init>(Unknown Source)
        at javax.net.DefaultSocketFactory.createSocket(Unknown Source)
        at org.apache.derby.client.net.OpenSocketAction.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        ... 19 more
java.lang.NullPointerException
        at
GUIModules.GeneralLoginGUIClass$2.widgetSelected(GeneralLoginGUIClass.java:108)
        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 GUIModules.ShellClass.eventloop(ShellClass.java:53)
        at
GUIModules.GeneralLoginEventLoop.generalloginshelleventloop(GeneralLoginEventLoop.java:28)
        at GUIModules.DefaultMain.main(DefaultMain.java:11)
Cannot load Databasejava.sql.SQLNonTransientConnectionException:
java.net.ConnectException : Error connecting to server 59.96.37.195 on port
1527 with message Connection refused: connect.
java.sql.SQLNonTransientConnectionException: java.net.ConnectException :
Error connecting to server 59.96.37.195 on port 1527 with message Connection
refused: connect.
        at 
org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown
Source)
        at org.apache.derby.client.am.SqlException.getSQLException(Unknown 
Source)
        at org.apache.derby.jdbc.ClientDriver.connect(Unknown Source)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at GUIModules.DataBaseClass.createConnection(DataBaseClass.java:31)
        at
GUIModules.GeneralLoginGUIClass$2.widgetSelected(GeneralLoginGUIClass.java:104)
        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 GUIModules.ShellClass.eventloop(ShellClass.java:53)
        at
GUIModules.GeneralLoginEventLoop.generalloginshelleventloop(GeneralLoginEventLoop.java:28)
        at
GUIModules.GeneralLoginGUIClass$2.widgetSelected(GeneralLoginGUIClass.java:138)
        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 GUIModules.ShellClass.eventloop(ShellClass.java:53)
        at
GUIModules.GeneralLoginEventLoop.generalloginshelleventloop(GeneralLoginEventLoop.java:28)
        at GUIModules.DefaultMain.main(DefaultMain.java:11)
Caused by: org.apache.derby.client.am.DisconnectException:
java.net.ConnectException : Error connecting to server 59.96.37.195 on port
1527 with message Connection refused: connect.
        at org.apache.derby.client.net.NetAgent.<init>(Unknown Source)
        at org.apache.derby.client.net.NetConnection.newAgent_(Unknown Source)
        at org.apache.derby.client.am.Connection.<init>(Unknown Source)
        at org.apache.derby.client.net.NetConnection.<init>(Unknown Source)
        at org.apache.derby.client.net.NetConnection40.<init>(Unknown Source)
        at
org.apache.derby.client.net.ClientJDBCObjectFactoryImpl40.newNetConnection(Unknown
Source)
        ... 21 more
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 java.net.Socket.connect(Unknown Source)
        at java.net.Socket.<init>(Unknown Source)
        at java.net.Socket.<init>(Unknown Source)
        at javax.net.DefaultSocketFactory.createSocket(Unknown Source)
        at org.apache.derby.client.net.OpenSocketAction.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        ... 27 more
java.lang.NullPointerException
        at
GUIModules.GeneralLoginGUIClass$2.widgetSelected(GeneralLoginGUIClass.java:108)
        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 GUIModules.ShellClass.eventloop(ShellClass.java:53)
        at
GUIModules.GeneralLoginEventLoop.generalloginshelleventloop(GeneralLoginEventLoop.java:28)
        at
GUIModules.GeneralLoginGUIClass$2.widgetSelected(GeneralLoginGUIClass.java:138)
        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 GUIModules.ShellClass.eventloop(ShellClass.java:53)
        at
GUIModules.GeneralLoginEventLoop.generalloginshelleventloop(GeneralLoginEventLoop.java:28)
        at GUIModules.DefaultMain.main(DefaultMain.java:11)
-- 
View this message in context: 
http://www.nabble.com/Connecting-to-Derby-Network-Server-through-the-Internet-tp17584140p17584140.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.

Reply via email to