Hello,
I got the below connection failed message when I’m trying to establish a connection from Splunk server to SCCM database.
jdbc:sqlserver://VITSCCMCB:1433;instanceName=CONFIGMGR;databaseName=CM_UCT;
Please see if there is any firewall blocks or any other settings/permissions to be enabled for the service account.
Splunk server details as below:
Hostname: lspsplkap16.ad
IP Address: 10.12.173.68
The SPLUNK server is in Domain ad, the SCCM Server is in Domain Med which is different...
SCCM Installed:
Thanks,
Dom
Hello,
It seems my issues is because I am using a connection accross domains...
This test was done within ADTEST domain. I will do a new test across domains AD to ADTEST as SPLUNK has restrictions on the JDBC string when doing a connection across domains. The parameter “integratedSecurity=true” does not work when using “Windows Authentication”. So to continue to use the “Windows Authentication” you need to specify the “domain_name” parameter.
“Windows Authentication” with “Microsoft JDBC Driver for SQL Server” is the recommended solution for a connection to a Windows SQL Server.
How to specify the domain in my statement:
on the url line?
on the connection line?
or both?
Both the account and server are in ADTEST when the SPLUNK server is in AD domain.
Any comment(s),
Thanks,
Dom
You may have problem with sql jdbc driver. You must use 4.2 version as stated in the documentation.
If this does not work you can try with SQL authentication rather than Integrated.
If you need to use Integrated authentication try jTDS driver too. This works better than MS version.
If this reply helps you, upvote appreciated.
Hello,
Apparently there is an issue with the path...
c:\Program Files\Microsoft JDBC DRIVER 8.4 for SQL Server\sqljdbc_8.4\enu>"c:\Program Files\Java\jdk1.8.0_271\bin\javac.exe" -cp jdbc.java
javac: no source files
Usage: javac <options> <source files>
use -help for a list of possible options
The driver is in C:\Program Files\Microsoft JDBC DRIVER 8.4 for SQL Server\sqljdbc_8.4\enu
Java is in C:\Program Files\Java\jdk1.8.0_271\bin
Anything missing?
Thanks,
Dom
Hello,
Some updates:
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class sqljdbc42
{
public static void main(String[] args)
{
Connection connection = null;
try
{
// the sql server driver string
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
// the sql server url
String url = "jdbc:microsoft:sqlserver://VITSCCMCB:1433;InstanceName=Configmgr;DatabaseName=CM_UCT";
// get the sql server database connection
connection = DriverManager.getConnection(url,"svc_ConfigMgr_SQL", "MNdOrQqk6HXef2PagZZe");
// now do whatever you want to do with the connection
// ...
}
catch (ClassNotFoundException e)
{
e.printStackTrace();
System.exit(1);
}
catch (SQLException e)
{
e.printStackTrace();
System.exit(2);
}
}
}
this compile properly with no error anymore...
C:\Program Files\Java\jdk1.8.0_271\bin>javac -cp . "C:\Program Files\Microsoft JDBC Driver 4.2 for SQL Server\sqljdbc_4.2\enu\jre8\sqljdbc42.java"
C:\Program Files\Java\jdk1.8.0_271\bin>
Next step trying to confirm the connection to the database...
Thanks,
Dom