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.getConnectio
n("jdbc:jt
ds:sqlserv
er://local
host/dbnam
e;user=sa;
password=s
a");
//sqlserver://host\instanc
e:port/dat
abase
// jdbc:jtds:<server_type>://
<server>[:
<port>][/<
database>]
[;<propert
y>=<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