• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Joe Ess
  • salvin francis

Connecting to MS SQL Server 2000 Personal Edition

 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You must make sure you have the MS SQL server driver jar files in you classpath.
 
Sameera Abeysinghe
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Aaaaaand ... we're on the march. Stylin. Get with it tiny ad.
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps
https://coderanch.com/t/722574/Sauce-Labs-World-Largest-Continuous
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!