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



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. This is a good written article!
It gave me

View Tutorial          By: Anders Branderud at 2010-01-10 03:24:25

2. I don't like Java for not supporting pointers.
View Tutorial          By: Yannbane at 2012-10-14 12:16:27

3. Hi, thi's sursh laveti, actually I'm getting a pro
View Tutorial          By: suresh l at 2015-06-24 07:53:19

4. I'd like to Thanks first bcoz your program is real
View Tutorial          By: Pawan at 2012-04-24 19:46:00

5. i want to open pdf file from sd card and i dont wa
View Tutorial          By: Karan Mavadhiya at 2013-01-30 12:02:30

6. Shouldn't you call free() on the allocated memory
View Tutorial          By: Ritchie at 2012-05-09 14:14:49

7. very nice explanation of STATIC....HAY man , you j
View Tutorial          By: harkeet at 2012-12-18 17:48:43

8. how to run this code....... Please tell somebody m
View Tutorial          By: Honey at 2015-01-24 14:27:38

9. j = 0;
while(--j)
{

View Tutorial          By: alistair at 2012-01-28 06:05:48

10. Hi mounika, Did you download and install the javac
View Tutorial          By: Ramlak at 2008-04-27 05:49:42