5

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?

Computernerd
  • 7,378
  • 18
  • 66
  • 95
Manuel
  • 347
  • 2
  • 6
  • 14

5 Answers5

6

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

Femi
  • 64,273
  • 8
  • 118
  • 148
  • How can i do that?. Which line i have to add? – Manuel Aug 02 '11 at 13:22
  • See http://download.oracle.com/docs/cd/E12840_01/wls/docs103/jdbc_admin/third_party_drivers.html: this tells you where you have to copy the JDBC driver to in Weblogic to use it. You can get the JAR file from http://msdn.microsoft.com/en-us/sqlserver/aa937724 – Femi Aug 02 '11 at 13:24
  • 1
    Thanks, 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" – Manuel Aug 02 '11 at 16:25
2

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.

Community
  • 1
  • 1
asboree
  • 89
  • 3
1

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

Fathah Rehman P
  • 8,401
  • 4
  • 40
  • 42
1

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"

Manuel
  • 347
  • 2
  • 6
  • 14
0

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 : https://i.stack.imgur.com/FHoiO.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

JP Tétreault
  • 600
  • 5
  • 15