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

5

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?

Lit answered 1/8, 2011 at 22:15 Comment(1)
Check your java project, looks like an import failedUther
V
6

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

Vickyvico answered 1/8, 2011 at 22:27 Comment(3)
How can i do that?. Which line i have to add?Lit
See download.oracle.com/docs/cd/E12840_01/wls/docs103/jdbc_admin/…: this tells you where you have to copy the JDBC driver to in Weblogic to use it. You can get the JAR file from msdn.microsoft.com/en-us/sqlserver/aa937724Vickyvico
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"Lit
S
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.

Sharell answered 5/1, 2016 at 9:46 Comment(0)
L
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"

Lit answered 2/8, 2011 at 16:27 Comment(0)
O
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

Orthodontia answered 16/5, 2012 at 9:33 Comment(0)
P
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.sstatic.net/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

Preeminent answered 29/7, 2014 at 4:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.