I just installed the JDBC driver from here for Sql Server (http://www.microsoft.com/en-us/download/details.aspx?id=11774) and I tested this sample code to test the connection:
http://msdn.microsoft.com/en-us/library/aa342339.aspx
The error I get seems to be in line:
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
java.lang.ClassNotFoundException:
com.microsoft.sqlserver.jdbc.SQLServerDriver
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
Two notes:
- If I remove the try-finally code I get NO error ==> which probably prooves there is nothing wrong with the user & password I created as login information to the database.
- I created a Person table with Contact as a column in my database.
Side questions:
- What exactly does this mean: localhost:1433
- How can I set Eclipse to show me what line triggers the error? Thank you very much!