aspose file tools*
The moose likes JDBC and the fly likes a q about SQL Server 2005 DB and Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "a q about SQL Server 2005 DB and Java" Watch "a q about SQL Server 2005 DB and Java" New topic
Author

a q about SQL Server 2005 DB and Java

Mahmoud Hadad
Ranch Hand

Joined: Jan 09, 2006
Posts: 67
i have an SE application that will be connecting to a SQL Server 2005 DB. At first a problem about the Driver arised when using Microsoft JDBC Driver( the problem was solved by enabling SQL Server Browser and enabling TCP/IP under Network Configuartion).the fix was inside SQL Server 2005 so does my user's need to install the whole SQL Server 2005 in order to use my App which will only be connecting to a SQL server 2005 DB on their local machines ?
[ September 29, 2006: Message edited by: Mahmoud Hadad ]
Masoud Kalali
Author
Ranch Hand

Joined: Jul 08, 2004
Posts: 531

SQL server is reqired just to run on the server and your clients should be able to connect to server from their own pc.
i have never used sql server 2005 , but with sql server 2000 , both with JTDS and microsoft provided JDBC driver you do not need to install anything from sql server package on the client machines.

as you know you need to pass the correct connection URL to your server in order to make clients able to connect to server.


hth


Masoud Kalali
Software Engineer - My Weblog - GlassFish Security
Mahmoud Hadad
Ranch Hand

Joined: Jan 09, 2006
Posts: 67
thanks for the reply, well when i made a connection to my sql server 2005 db it gave an error which was ClassNotFoundException No Suitable Driver Found, the solution was to enable something called SQL Server Browser inside the Configuartion Manager in SQL Server 2005 and enabling TCP/IP in the Network Configuration so all of these things were done inside SQL Server 2005 so i can get a Connection object from the DriverManager and as i understood from a post from someone from Microsoft that JDBC connects to SQL Server 2005 DB via TCP/IP only. so should my users install the whole SQL Server 2005 in order to use my App?
my Application does not connect to a remote DB ,it connects to a DB that comes with my App only.
[ September 29, 2006: Message edited by: Mahmoud Hadad ]
Masoud Kalali
Author
Ranch Hand

Joined: Jul 08, 2004
Posts: 531

NoClassDefFound and no suitable driver found means that
-you did not include the driver into your classpath
-you are not using a correct connection url that is supported by your registered driver.

as far as i know , MS has changed its connection url in jdbc driver 2005 , so you may need to look at the documentation to ensure that you are using a correct url and Driver class.

the only suggestion that i can give you is to try to use JTDS driver and see whether you have the same problem with it or not.

by default when we install SQL server it uses TCP/IP protocol and IIRC it has options for pipe and IPS/SPX either .

please try the JTDS and let us know the result.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


by default when we install SQL server it uses TCP/IP protocol


This is no longer true for SQL Server 2005. By default TCP/IP is disabled and you will need to enable it to connect via JDBC.


so should my users install the whole SQL Server 2005 in order to use my App?

No. Assuming your server is configured correctly, your users will only need the jdbc driver to connect.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
jQuery in Action, 2nd edition
 
subject: a q about SQL Server 2005 DB and Java