This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes Connecting to MS SQL Server 2000 Personal Edition Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Connecting to MS SQL Server 2000 Personal Edition " Watch "Connecting to MS SQL Server 2000 Personal Edition " New topic
Author

Connecting to MS SQL Server 2000 Personal Edition

Sameera Abeysinghe
Ranch Hand

Joined: Nov 15, 2004
Posts: 104
Hi all,
I try to connect to MS SQL Server using the file below
/////////////////////////////////////////////////////////////////////

class Test1{
Test1(){
try{
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
System.out.println("Name");
System.out.println("connect to driver");
Connection conn = DriverManager.getConnection("jdbc:microsoft:sqlserver://192.168.0.112:1433;user=stromme;password=stromme");
//Statement stmt=conn.createStatement( );
System.out.println("Conn");
}
catch(Exception e){System.out.println("Error"+e);}
}
public static void main(String args[]){
Test1 test=new Test1();
}
}

/////////////////////////////////////////////////////////////////////
But I got this error
////////////////////////////////////////////////////////////////////

C:\java>java Test1
Errorjava.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver

C:\java>

////////////////////////////////////////////////////////////////////
Any one place explain this and tell me how to connect to the server

Thank You.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

You must make sure you have the MS SQL server driver jar files in you classpath.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Sameera Abeysinghe
Ranch Hand

Joined: Nov 15, 2004
Posts: 104
Thanks Paul

But this is not enough
You have to explain it
Like what this jar file do where can I get it or it comes with jdk
How to set this class path
Ok
Thank You for the reply
Sameera Abeysinghe
Ranch Hand

Joined: Nov 15, 2004
Posts: 104
I found out that i need this driver
SQL Server 2000 Driver for JDBC
can any one tell me a place to get it
Thank You.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Connecting to MS SQL Server 2000 Personal Edition
 
Similar Threads
JDBC with MS SQL 2000
Connecting to sql
Connecting to sql server
HELP please with SQL Server
Problems regarding MS JDBC Driver and JTDS-JDBC Connectivity for MS SQL Server 2000