Comment on Tutorial - JSP Example to connect to MS SQL database and retrieve records By Abinaya



Comment Added by : NT.Jay

Comment Added at : 2011-10-06 05:33:09

Comment on Tutorial : JSP Example to connect to MS SQL database and retrieve records By Abinaya
Dear Friends, I get the following exception...
java.sql.SQLException: Network error IOException: Connection refused: connect
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:410)..

My Code is....
String driverName = "net.sourceforge.jtds.jdbc.Driver";
String url = "jdbc:jtds:sqlserver://localhost:1433";
Class.forName(driverName);
DriverManager.getConnection(url);
System.out.println("Connected Successfully");

Please give the solution for that one...
Thanks...
at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:184)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at com.thanas.test.DBSCONNECTION.getConnection(DBSCONNECTION.java:20)
at com.thanas.test.DBSCONNECTION.main(DBSCONNECTION.java:10)
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:307)
at net.sourceforge.jtds.jdbc.SharedSocket.<init>(SharedSocket.java:257)
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:311)
... 6 more


View Tutorial



Ask a Question

Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. thank you sir, please provide me string array in d
View Tutorial          By: ravi gupta at 2012-01-17 17:04:33

2. I deploy a project in apache tomcat and backend to
View Tutorial          By: satish at 2010-08-04 05:31:59

3. Very well explained Thanks.
View Tutorial          By: Anthony at 2012-12-12 00:20:39

4. Thanks for this great tutorial... was looking for
View Tutorial          By: Shashi at 2012-09-20 11:35:08

5. Thanks bro...you save me from a great problem...ve
View Tutorial          By: Tishan at 2012-07-09 09:14:07

6. hii
i have

two varirables
View Tutorial          By: niranjan at 2012-07-31 06:47:36

7. Yes Left shift result is wrong its like
5

View Tutorial          By: Ragunath k at 2010-05-10 04:45:33

8. nice tutorial man !
View Tutorial          By: yash at 2012-11-10 05:08:31

9. This is so phat. Maybe the best explanation ever t
View Tutorial          By: Devin Prince III at 2010-08-11 10:01:04

10. Nice Example.Good work.keep it up.
Thanks,<

View Tutorial          By: Lucky at 2011-07-08 10:36:38