Advertisement

11.17.2005 at 07:41AM PST, ID: 21634426
[x]
Attachment Details

jtds driver error Network error IOException: Connection refused: connect

Asked by ethnarch in Java Programming Language

Tags: connection, error, network, jtds, refused

I am trying to connect to msde with the jtds driver.  I keep getting this error:

Network error IOException: Connection refused: connect

I have read a lot of stuff about firewalls blocking the connection and all kinds of other network errors.  The problem though is that i can program the same connection in another language C++ or VB.net and i don't get any errors.  Also i am just trying to make the connection on the localhost.

I am new to java so maybe it's just something really stupid i am doing. Here is the code i am using to make the connection

            Driver d = (Driver)Class.forName( "net.sourceforge.jtds.jdbc.Driver" ).newInstance();
            Connection con = DriverManager.getConnection("jdbc:jtds:sqlserver://localhost/dbname;user=sa;password=sa");
            //sqlserver://host\instance:port/database
            //  jdbc:jtds:<server_type>://<server>[:<port>][/<database>][;<property>=<value>[;...]]
            Statement stmt = con.createStatement();
            stmt.executeUpdate(str);

oh yeah and str is a really long insert statement. I dont' think that's the problem but if you need to see it let me know i'll copy and paste it here.Start Free Trial
 
Loading Advertisement...
 
[+][-]11.17.2005 at 09:40AM PST, ID: 15313523

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.17.2005 at 11:43AM PST, ID: 15314555

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.17.2005 at 11:46AM PST, ID: 15314577

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.18.2005 at 10:51AM PST, ID: 15322026

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Java Programming Language
Tags: connection, error, network, jtds, refused
Sign Up Now!
Solution Provided By: Netminder
Participating Experts: 1
Solution Grade: B
 
 
 
Loading Advertisement...
20080716-EE-VQP-32