wood burning stoves 2.0*
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
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
HELP please with SQL Server
JDBC with MS SQL 2000
Problems regarding MS JDBC Driver and JTDS-JDBC Connectivity for MS SQL Server 2000
Connecting to sql
Connecting to sql server