Anaplan Connect SQL - Cannot Connect to Database

We receive the below error when trying to connect to the SQL database.

Anaplan API: Could not connect to database! (SQL server: Login failed for user)

However, our test odbc connection on the server connects successfully, so the credentials are valid.

What do we need to do to resolve this and connect successfully?

Below is our .bat file.

@echo off

set AnaplanUser="ANPLANUSERNAME:ANAPLANPASSWORD"
set WorkspaceId="ID"
set ModelId="ID"
set ServiceUrl="https://ca1a.api.anaplan.com"
set AuthUrl="https://ca1a.auth.anaplan.com"
set FileName="Anaplan_Test.csv"
set FilePath="C:\Automation\Anaplan_Test.csv"
set ProcessName="Import SQL SAGE GLAFS"
set jdbcProperties="C:\Automation\Anaplan-Connect\jdbc-query.properties"
set DumpName="C:\Automation"
set Chunksize=1

set Operation=-debug -service %ServiceUrl% -auth %AuthUrl% -workspace %WorkspaceId% -model %ModelId% -chunksize %Chunksize% -file %FileName% -jdbcproperties %jdbcProperties% -put %FilePath% -process %ProcessName% -execute -output %DumpName%

rem *** End of settings - Do not edit below this line ***

setlocal enableextensions enabledelayedexpansion || exit /b 1
cd %~dp0
if not %AnaplanUser% == "" set Credentials=-user %AnaplanUser%
set Command=.\AnaplanClient.bat %Credentials% %Operation%
@echo %Command%
cmd /c %Command%
pause

Below is our jdbc properties file.


jdbc.connect.url=jdbc:sqlserver://SERVERNAME:PORTNUMBER;database=DATABASENAME;encrypt=true;trustServerCertificate=true;

jdbc.username=USERNAME
jdbc.password=PASSWORD

jdbc.fetch.size=2500

jdbc.isStoredProcedure=false

jdbc.query=SELECT GLAFS.ACCTID, GLAFS.FSCSYR, GLAFS.FSCSDSG, GLAFS.FSCSCURN, GLAFS.CURNTYPE, GLAFS.AUDTDATE, GLAFS.AUDTTIME, GLAFS.AUDTUSER, GLAFS.AUDTORG, GLAFS.SWRVL, GLAFS.CODERVL, GLAFS.SCURNDEC, GLAFS.OPENBAL, GLAFS.NETPERD1, GLAFS.NETPERD2, GLAFS.NETPERD3, GLAFS.NETPERD4, GLAFS.NETPERD5, GLAFS.NETPERD6, GLAFS.NETPERD7, GLAFS.NETPERD8, GLAFS.NETPERD9, GLAFS.NETPERD10, GLAFS.NETPERD11, GLAFS.NETPERD12, GLAFS.NETPERD13, GLAFS.NETPERD14, GLAFS.NETPERD15, GLAFS.ACTIVITYSW, GLAMF.ACCTID, GLAMF.ACCTDESC, GLAMF.ACCTTYPE, GLAMF.ACSEGVAL01, GLAMF.ACSEGVAL02, GLAMF.ACSEGVAL03, GLAMF.ACSEGVAL04 FROM ALOPGP.dbo.GLAFS GLAFS, ALOPGP.dbo.GLAMF GLAMF WHERE GLAFS.ACCTID = GLAMF.ACCTID AND ((GLAFS.FSCSYR>'2016') AND LAFS.ACTIVITYSW<>0))

Thank you!

Answers

  • vitexbakle
    edited August 15

    If you're encountering a "Cannot Connect to Database" error with Anaplan Connect SQL, first ensure that your database credentials, connection URL, and network settings are correct. Verify that the database server is running and accessible from your network.

    Check for any firewall or security settings that might be blocking the connection. Additionally, confirm that you have the correct driver for your database sherman oaks and that it is properly configured in your Anaplan Connect settings. If the issue persists, review the logs for detailed error messages and consult your database or Anaplan support for further assistance.