Method to run liquibase update command in a .bat file or by jar

@ronak Can u please tell me how can I run the liquibase update command by using a .bat file for MongoDB as I am getting the following error :

Unexpected error running Liquibase: java.lang.RuntimeException: Driver class was not specified and could not be determined from the url (mongodb://localhost:27017/myDatabase?readPreference=primary&appname=MongoDB%20Compass&ssl=false)

My Liquibase. properties has :
changeLogFile: dbchangelog.xml
url: mongodb://localhost:27017/myDatabase?=primary&appname=MongoDB%20Compass&ssl=false

in the .bat file I have :
java -jar liquibase.jar --changeLogFile=changeLogs\dbchangelog.xml --defaultsFile=changeLogs\ update

When running the liquibase update command in the changeLogs folder is working but i need to do that using the .bat file

Hi @Subhadeep08

Please Read through this forum post. This should help you in some or the other way.

I think the issue is with setting classpath while running Liquibase update.

Try checking this and do let us know if it helps.

Rakhi Agrawal

My actual doubt is regarding the Driver class that needs to be specified in for the case of MongoDb which i’m not able to find in mongo-java-driver-3.12.8.jar (the jar given in official page of mongoDb). Kindly help me with driver class name that needs to be given along with the classpath of the jar having the driver class

Hi @ronak can u please help me with the above mentioned issue. I’m kinda stuck for a long time