TDI to MSSQL

If you are just using a script block


Download the sql driver from MS


Extract it to TDI's jar folder 
tar -xzf sqljdbc_3.0.1301.101_enu.tar.gz  #or whatever the current version name is
sudo cp -r sqljdbc_3.0 /opt/IBM/TDI/V7.1/jars/3rdparty/others/


Create a new assembly line and you can test the basics with a simple script block
// Test Connection String
 var url = "jdbc:sqlserver://some.server:port;databaseName=myDatabase;user=myUser;password=myPass;"


// Get a connetion to the database
try {
task.logmsg("Getting a connection ");
var conn =  java.sql.DriverManager.getConnection(url);

} catch(err){

task.logmsg("ERROR","Cannot connect to database, exiting");
system.abortAssemblyLine(err.toString());
}



One no longer needs to register the ms driver with the sql connection manager, as one had to do in the past. 


----
Comments