Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Connect to MSSQL Database using Redwood Script

Hi guys, I'm trying to connect mssql database using job created inside redwood.

The idea behind this is to send the job information to external database so that it can be used for analytical report.

Currently, I've managed to pull the job information in redwood but stuck on connecting to respective database.

Have anyone tried this before? Thanks..


String a = RaiseJobID; //get jobID using event trigger

Long jobID = Long.decode(a);

Job job = jcsSession.getJobByJobId(jobID);

JobDefinition jobDef = job.getJobDefinition();

String startRun = job.getRunStart().toFormattedString("yyyy-MM-dd HH:mm:ss").toString();

String endRun = job.getRunEnd().toString();

String jobName= jobDef.getName();

String jobState= job.getStatus().getState().toString();

String jobStatus= job.getStatus().toString();

String endRunF = job.getRunEnd().toFormattedString("yyyy-MM-dd HH:mm:ss").toString();

String host = "";

String uName = "";

String uPass = "";

String query =  "INSERT INTO rw_tableau ('"+jobName+"','"+jobState+"','"+jobStatus+"','"+startRun+"','"+endRunF+"')";


//Connection con = DriverManager.getConnection(host, uName, uPass); //connection for mssqldatabase


Former Member
Not what you were looking for? View more on this topic or Ask a question