Cannot load driver: com.microsoft.sqlserver.jdbc.SQLServerDriver weblogic 12C - sql-server

I have a weblogic 12C server which is trying to connect to a MSSQL 2014 DB. I encountered the following issue :
Cannot load driver: com.microsoft.sqlserver.jdbc.SQLServerDriver
I have already check the following solution
The suggested solution does not apply to me as in D:\wls12210\wlserver\common\bin, it does not contain the commEnv.cmd file for me to add the new classpath in.
A look at the documentation suggests Edit the commEnv.cmd/sh script in WL_HOME/common/bin which is the same as the suggest solution
Where is the misssing commEnv.cmdin weblogic 12c ??

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.
Please try as mentioned. I assumed you are using version weblogic 12.2.1 based on the directory structure in the post. When searching for anything in weblogic documentation, I usually search with weblogic version in the search query so it may take you to relevant weblogic documentation(obviously oracle has documentation for several versions). In this case I'm not sure if anything has changed between the versions, but anyway its a good thing to use the version in search query first.

Related

ORA-28040: After Upgrade Database to 12c from 11g

Problem Statement:
We are doing a migration activity in which we have migrated DATABASE from ORACLE 11g to ORACLE 12c.
After upgrade one of our application which is using jdk 6 with ojdbc6.jar (JDBC Driver) is not able to connect the 12c database.
Below error we are getting :
java.sql.SQLException: ORA-28040:
No matching authentication protocol
after Upgrade Database to 12c
Configuration
JDK Version : 1.6
JDBC Driver : ojdbc6.jar
Database Version : Oracle 12c
SQLNET.ALLOWED_LOGON_VERSION_SERVER = 11
SQLNET.ALLOWED_LOGON_VERSION_CLIENT = 11
Workaround tried:
1) We tried to run a simple jdbc application with jdk1.6 and ojdbc6.jar it was successful. Also it is as per Oracle Compatibility matrix.
2) We asked to update the parameter SQLNET.ALLOWED_LOGON_VERSION_SERVER = 8 but security team cannot do it as it does not comply on security standards.
Please suggest how we should proceed forward to fix this issue.
The problem was then weblogic.jar and from the classpath of weblogic.jar, ojdbc14.jar was being referred. We checked in WL_HOME\server\lib library and found that ojdbc14.jar was there. We just let keep it there but copied ojdbc6.jar in some external directory and loaded same in CLASSPATH before all jars. Below is from oracle docs-
This driver is installed in the WL_HOME\server\lib folder (where WL_HOME is the folder where WebLogic Server is installed) with weblogic.jar. The manifest in weblogic.jar lists this file so that it is loaded when weblogic.jar is loaded (when the server starts). Therefore, you do not need to add this JDBC driver to your CLASSPATH. If you plan to use a third-party JDBC driver that is not installed with WebLogic Server, you must install the drivers, which includes updating your CLASSPATH with the path to the driver files, and may include updating your PATH with the path to database client files. See "Supported Database Configurations" on the Oracle Fusion Middleware Supported System Configurations page at http://www.oracle.com/technology/software/products/ias/files/fusion_certification.htmlOpens a new window.
If you plan to use a different version of any of the drivers installed with WebLogic Server, you can replace the driver file in WL_HOME\server\lib with an updated version of the file or add the new file to the front of your CLASSPATH.
So if you are facing the same issue I would like to suggest-
1) Check for the Oracle driver (ojdbc) - as the most post on StackOverflow suggest same.
You can check ojdbc driver compatibity here
2) If you cannot change driver immediately the change below in sqlnet.ora
SQLNET.ALLOWED_LOGON_VERSION_SERVER=8
SQLNET.ALLOWED_LOGON_VERSION_CLIENT=8
(SQLNET.ALLOWED_LOGON_VERSION is depreciated in 12c. Also, please be noted that In 12c, the default value for the SQLNET.ALLOWED_LOGON_VERSION_SERVER parameter has been updated to “11”. This means that database clients using pre-11g JDBC thin drivers cannot authenticate to 12.1 database servers unless the parameter is set to the old default of “8”)
For your reference, please check-
https://docs.oracle.com/database/121/UPGRD/deprecated.htm#UPGRD60010
https://docs.oracle.com/database/121/UPGRD/afterup.htm#UPGRD60157
Thanks.

JDBC URL connection to SQL Server using Windows Authentication in JIRA plugin

I am currently at my wits end. I am trying to connect a JIRA plugin (Atlassian Java SDK) to a SQL Server 2012 database. It's required that I use Windows Authentication, but JIRA is logging:
com.microsoft.sqlserver.jdbc.SQLServerException: This driver is not configured for integrated authentication.
I've read that this can be combatted by adding the sqljdbc_auth.dll file to the program's library path, but there are no references specifically for JIRA plugins on how to do this other than for the base JIRA dbconfig.xml, which I am not using. This is a connection made within the plugin using the code:
String url = String.format("jdbc:sqlserver://%s:1433;databaseName=%s;integratedSecurity=true;domain=XXXX;", server, database);
I have tried to add the dll file to the following locations, all to no avail:
C:/{JIRA INSTALL PATH}/bin
C:/{JIRA INSTALL PATH}/jre/bin
C:/{JAVA INSTALL PATH}/jre_8.x.x/bin
What gives?
UPDATE:
I have gone in and added the JDBC JAR/DLL to the classpath/library path respectively in the JIRA Windows service configuration tool. Still getting the same error.
UPDATE 2:
I have switched to using the JTDS driver to see if JIRA was just not able to use the standard JDBC driver for some reason, but getting a similar error:
java.sql.SQLException: I/O Error: SSO Failed: Native SSPI library not loaded. Check the java.library.path system property.
I have also created a new Java app to test this in a controlled environment, but do not get this error after adding the ntlmauth.dll file to the C:\Windows\System32 directory. This leads me to believe this may be a bug within JIRA or I have something configured improperly.
Here is my own conclusion after many weeks of searching:
It is (currently) impossible to do this without the use of a password (which is sometimes the entire point of using Windows/Active Directory credentials). You can however use the JTDS driver in junction with a domain, username, and password to authenticate to servers that require windows authentication. This does not solve the core issue, but from what I can tell is the only current solution close enough to it.

I'm deploying Google connector for database on my server. How to find the classname of my JDBC driver?

I'm deploying google search appliance connector for database(SQL). I'm filling the information in the GSA hostname and other required variable.
One section says to enter the full classname of JDBC driver. It has an example:
oracle.jdbc.OracleDriver
How should I find the full classname of my JDBC driver that I installed?
Any help would be appreciated. Thank you
If you have the JAR file, for the drive, you can open it up (it is a zip) and then browse the directory structure. You'll be looking for something like what you see for Oracle.
Postgres uses:
org.postgresql.Driver
MS SQL uses:
com.microsoft.sqlserver.jdbc.SQLServerDriver
MySQL uses:
com.mysql.jdbc.Driver
Using that pattern, you should be able to figure it out.
Terry

How to connect to sql DB from soapUI using connection string?

I would like to ask someone who already tried to connect to SQL database from soapUI opensource version.
I have a test step JDBC request where I try to test and connect to my sql database. I use opensource version of soapUI. I read how it should be set up but still experience some problems.
This is what I do:
I installed java 8 and jdbc driver version 4.1. Added jdbc jar file to SoapUi/jre/bin folder as it is said in documentation for soapUI. This version of driver should work with Java 8.
Then in Driver field I write
com.microsoft.sqlserver.jdbc.SQLServerDriver
In connection string:
jdbc:sqlserver://Sservername:portnumber;databaseName=Consumption;username=alyona.kovalyova;password=mypassword
I get error saying
Can't get the Connection for specified properties; com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'alyona.kovalyova'. ClientConnectionId...
I use my domain account because in our company the policy does not allow us to use database user. Because of this I tried to add integratedSecurity parameter to the string which should allow to login with windows account like this:
jdbc:sqlserver://S23-AS:1433;databaseName=Consumption;integratedSecurity=true
I also get error:
Can't get the Connection for specified properties; com.microsoft.sqlserver.jdbc.SQLServerException: This driver is not configured for integrated authentication. ClientConnectionId..
Does anyone encountered the same issue before? Could you give some recommendation?
For integrated authentication to work you'll need sqljdbc_auth.dll matching your environment (32bit / 64bit) in your library path (putting it in bin as well might help already)

MS SQL driver issue with Struts 2 tomcat 7

I am developing web application using Tomcat 7 and connecting to a MSSQL 2008 DB.
While executing a DB operation from any Java console based application, it succeeds. Same code fails to execute while performing same operations from web application with the message "No suitable drivers found". We are using sqljdbc4
URL private String url = "jdbc:sqlserver://10.100.41.232;databaseName=iptvdb;";
Not able to understand the this strange behaviour. Any workarounds?
Also tried with : port 1433 but it's still not working.
That error means it cant find the JDBC driver on your classpath. Do you have the JDBC driver? You need to have the MySQL JDBC drivers. If you dont have it, it can be downloaded from the MySQL website.
If you do have the driver or have downloaded it, make sure it is in the correct place. It needs to be placed on your classpath. This usually means one of two places
With your Struts application under the WEB-INF/lib folder
With the application server. For tomcat this is usually in $CATALINA_HOME/lib

Resources