在加载jdbc中出现错误,而且在JRE System library中没有关于sql的任何jar包,请问怎么回事?
java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at tag.DB.DBConn.getConnection(DBConn.java:29)
at tag.DB.DBConn.getTag(DBConn.java:53)
at tag.DB.DBConn.main(DBConn.java:230)
Exception in thread "main" java.lang.NullPointerException
at tag.DB.DBConn.getTag(DBConn.java:54)
at tag.DB.DBConn.main(DBConn.java:230)
------解决方案--------------------
楼主把jdbc。jar导入进来就可以了。
------解决方案--------------------