I have installed SqlServer2000 jdbc in my machine, set classpath as following: c:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\msbase.jar;c:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\msutil.jar;c:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\mssqlserver.jar But when I run the codes like : try { Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver"); Connection c = DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;User=administrator;Password=calvin"); } catch(Exception e) { System.out.println(e.toString()); } I always get the following exception: java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver Could anyone help me? thanks
Are you building a stand-alone application or using an application server? If you're using an application server, you need to include the jar file in (for example) the web-inf/lib directory for it to be visible in a web application. Dave
hi Lasse, I tried the ways you teached me, and there is no jdbc setting in it. I don't know why. I really set classpath in my operation system, but it looks different from what I printed by using {System.getProperty("java.class.path")}. Where can I set that variable? Thanks for teaching.
quick thought? when you run your app from the command line, do you include the driver jar in the -classpath option? something like java -cp driverjar.jar MainClass
Calvin Y. Hey buddy! I need you to do me a favor. Could you change your display name to meet our Naming Policy. The policy does not allow First Name Last Initial. But it does allow First Initial Last Name. For example, you could change it to Y. Calvin. Thanks partner. Hope to see more of you around the Ranch. BTW - You can change your display name here See you around. [ August 21, 2003: Message edited by: Gregg Bolinger ]