Cannot load driver: com.microsoft.sqlserver.jdbc.SQLServerDriver weblogic 10g

你离开我真会死。 提交于 2019-12-23 09:59:14

问题


I'm trying to create a datasource from weblogic 10.3 to sqlserverexpress 2008 r2, but when I test the connection, the following message appears :

Cannot load driver: com.microsoft.sqlserver.jdbc.SQLServerDriver

What should I do?


回答1:


You need to add the sqlserver JDBC driver jar file to the weblogic classpath.




回答2:


I add sqljdbc4.jar to %WLHome%/Server/Lib and i add the following line to the weblogic_classpath in %WLHome%\common\bin\commEnv.cmd: ";%WL_HOME%\server\lib\sqljdbc4.jar"




回答3:


add "sqljdbc.jar" file to the weblogic classpath

To download go to http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=11774




回答4:


From weblogic 1221 documentation here :

To use third-party JDBC drivers that are not installed with WebLogic Server, you can add them to the DOMAIN_HOME/lib directory, where DOMAIN_HOME represents the directory in which the WebLogic Server domain is configured. The default path is ORACLE_HOME/user_projects/domains. For more information, see "Adding JARs to the Domain /lib Directory" in Developing Applications for Oracle WebLogic Server.

This solution seems better than updating the weblogic class path, as it will impact the other domains. For example say two domains want to use different versions of the jdbc driver. In this case updating the class path through commEnv.cmd might case issues. Of course the flip side would be that you have to place/link the driver jars in both the domian's lib directory.




回答5:


For some reasons, the above answers did not work for me so I ended up choosing Oracle MS SQL Server Driver instead of the one of Microsoft. See : http://i.imgur.com/s9sr5xs.jpg

Then if you have trouble with the instance name, you can try specifying the port instead. To get the port number, open Sql Server Configuration Manager : SQLServerManager11.msc



来源:https://stackoverflow.com/questions/6905156/cannot-load-driver-com-microsoft-sqlserver-jdbc-sqlserverdriver-weblogic-10g

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!