The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
Just thought I might rant a bit.
Simply trying to use MS example and driver to use Java to connect to sql server.
The only error I can ever get is: java.sql.SQLException: No suitable driver found for jdbc:sqlserver://
I don't believe it is finding the proper jar file.
I noticed that when I build via javac that even if I provide a bad path to the jar or whatever, the "compiler" happily rolls on. Oy! No way to even tell if javac is incorporating the jar.
Assuming the JAR is already added in your classpath, try adding Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); before the call to DriverManager.getConnection. I think that's still the full name of the SQL Server driver at least. Those are the two things that commonly cause this error.
Also if you're curious why javac doesn't seem to care, from what I understand it's because the SQLServerDriver class is never referenced in your code and therefore unnecessary for javac. DriverManager doesn't explicitly load driver classes, it just fetches them which is why you need to explicitly load the class via Class.forName.