Hola a todos,
Estoy programando en java y como me conecto es de la siguiente forma:
Properties p = new Properties();
p.put("user", "sa");
p.put("password","123");
p.put("selectMethod", "direct");
p.put("DatabaseName", "pubs");
conn = java.sql.DriverManager.getConnection("jdbc:jtds:sq lserver://HOME:1433/pubs", p);
y me da el siguiente error:
java.sql.SQLException: Network error IOException: Connection refused: connect
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(C onnectionJDBC2.java:372)
at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(C onnectionJDBC3.java:50)
at net.sourceforge.jtds.jdbc.Driver.connect(Driver.ja va:178)
at java.sql.DriverManager.getConnection(DriverManager .java:525)
at java.sql.DriverManager.getConnection(DriverManager .java:140)
at Conectarse.<init>(Conectarse.java:69)
at Escolare.Cargar(Escolare.java:318)
at Escolare.btnAceptarActionPerformed(Escolare.java:1 97)
at Escolare.access$1600(Escolare.java:13)
at Escolare$17.actionPerformed(Escolare.java:157)
at javax.swing.AbstractButton.fireActionPerformed(Abs tractButton.java:1849)
at javax.swing.AbstractButton$Handler.actionPerformed (AbstractButton.java:2169)
at javax.swing.DefaultButtonModel.fireActionPerformed (DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultB uttonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener$Actions .actionPerformed(BasicButtonListener.java:287)
at javax.swing.SwingUtilities.notifyAction(SwingUtili ties.java:1571)
at javax.swing.JComponent.processKeyBinding(JComponen t.java:2763)
at javax.swing.JComponent.processKeyBindings(JCompone nt.java:2798)
at javax.swing.JComponent.processKeyEvent(JComponent. java:2726)
at java.awt.Component.processEvent(Component.java:526 5)
at java.awt.Container.processEvent(Container.java:196 6)
at java.awt.Component.dispatchEventImpl(Component.jav a:3955)
at java.awt.Container.dispatchEventImpl(Container.jav a:2024)
at java.awt.Component.dispatchEvent(Component.java:38 03)
at java.awt.KeyboardFocusManager.redispatchEvent(Keyb oardFocusManager.java:1810)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEv ent(DefaultKeyboardFocusManager.java:672)
at java.awt.DefaultKeyboardFocusManager.preDispatchKe yEvent(DefaultKeyboardFocusManager.java:920)
at java.awt.DefaultKeyboardFocusManager.typeAheadAsse rtions(DefaultKeyboardFocusManager.java:798)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent (DefaultKeyboardFocusManager.java:636)
at java.awt.Component.dispatchEventImpl(Component.jav a:3841)
at java.awt.Container.dispatchEventImpl(Container.jav a:2024)
at java.awt.Window.dispatchEventImpl(Window.java:1778 )
at java.awt.Component.dispatchEvent(Component.java:38 03)
at java.awt.EventQueue.dispatchEvent(EventQueue.java: 463)
at java.awt.EventDispatchThread.pumpOneEventForHierar chy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarch y(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThre ad.java:110)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl .java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSoc ketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.j ava:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.j ava:366)
at java.net.Socket.connect(Socket.java:516)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at net.sourceforge.jtds.jdbc.SharedSocket.createSocke tForJDBC3(SharedSocket.java:289)
at net.sourceforge.jtds.jdbc.SharedSocket.<init>(Shar edSocket.java:250)
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(C onnectionJDBC2.java:297)
... 38 more
Como pueda hacer para conectarme?, se los agradeceria mucho
mi correo es [email protected]