SQL Server JDBC driver
Connect Scriptella to SQL Server using the built-in mssql adapter and an external JDBC driver.
Install the JDBC driver
Download the official JDBC driver for Maven coordinate com.microsoft.sqlserver:mssql-jdbc:13.6.0.jre11. Place mssql-jdbc-13.6.0.jre11.jar in a lib/ directory next to your ETL file.
JDBC class com.microsoft.sqlserver.jdbc.SQLServerDriver. The example below shows the JDBC URL format.
Check the connection
Replace the sample host and database or service name. Replace DEMO_USER and DEMO_PASSWORD with your local demo credentials. Save this as check.etl.xml, then run scriptella.sh check.etl.xml. The read-only query passes the connection_ok column to the nested script, which prints CONNECTION OK: 1.
<?xml version="1.0"?>
<!DOCTYPE etl SYSTEM "http://scriptella.org/dtd/etl.dtd">
<etl>
<connection id="db" driver="mssql"
url="jdbc:sqlserver://db.example.com:1433;databaseName=app;encrypt=true;trustServerCertificate=false"
user="DEMO_USER" password="DEMO_PASSWORD"
classpath="lib/mssql-jdbc-13.6.0.jre11.jar"/>
<connection id="console" driver="text"/>
<query connection-id="db">
SELECT 1 AS connection_ok;
<script connection-id="console">CONNECTION OK: $connection_ok</script>
</query>
</etl>
Keep real passwords out of version control. For shared or deployed ETL files, set SCRIPTELLA_DB_USER and SCRIPTELLA_DB_PASSWORD in the process environment and use user="${env.SCRIPTELLA_DB_USER}" and password="${env.SCRIPTELLA_DB_PASSWORD}" in the connection.
Verified with Scriptella 1.7.0
SQL Server 2022 CU26 on Linux with JDBC driver 13.6.0.jre11. The public Testcontainers check passed ETL copy, representative values, and rollback. Coverage is limited to this Linux configuration.
Configuration notes
Use a hostname that matches the server certificate and configure the JVM trust store to trust its issuer.