hello viewers.


i have some problems in java database connectivity.

the code compiles successfully but , when i execute the code it gives this error " error establishing socket connection".

i have applied several solutions e.g enable tcp/ip in sql server, checking the name of sql server., giving ip to network card(though i am working on a single pc no connectivity to network is available)., used mixed mode sql server authentication., used new login and passwords.

when i execute netstat on dos prompt no protocol or socket no is listed.
when i use telnet(computername) 1433 , it cannot make connection.

these are all the work which i have done but there is no result.

plz help me in this case.
thanks.

What type of jdbc connection u used in ur program. please use jdbc-odbc bridge connection to ur sql server. So fst u create the DSN. after u that name in ur prg.

Comments
The JDBC-ODBC bridge is the worst driver among all the four types, you should not recommend.

No, do not use the JDBC-ODBC Bridge. Use the actual JDBC Driver whenever there is one available.

@OP Have you configured your Windows Firewall to allow connections to that port?

i think U cannt use JDBC connection with SQL Server. Search some thing abt this

Comments
Continues to ignore the "no text-speak" policy. Use actual English or don't bother.

thanks for the reply.

i am using the original jdbc driver from microsoft. i connect to the sqlserver 2000.


i have alsor tried the solution of allowing the firewall of windows xp to "off" state.

no i am going to try dsn , and then inform all of u.

thx for replying.

do NOT use ODBC!

you're having network problems. Either the server refuses your connection at the network level, your JDBC URL is incorrect (pointing to something where there is no server for example), your client refuses the connection (unlikely if you've turned off the firewall on it), or something else in your network blocks the traffic.

How are u trying to connect to the SQL server database, using which protocol ?
TCP/IP or via NamedPipes,
Check whether the method u r trying is enabled on the SQL Server you are trying to connect to.

How are u trying to connect to the SQL server database, using which protocol ?
TCP/IP or via NamedPipes,
Check whether the method u r trying is enabled on the SQL Server you are trying to connect to.

Sorry had not read the complete post !!!

when i execute netstat on dos prompt no protocol or socket no is listed.
when i use telnet(computername) 1433 , it cannot make connection.

Try using namedPipes, instead of TCP connection (its supposed to be faster if your server is on the same machine as it would bypass the network layer) for connecting to your SQL Server.

hello

what is the driver name for connecting to sql server and where can i find the jar file.

write some sample code


thnx

This article has been dead for over six months. Start a new discussion instead.