Please note that Sahi's development and support teams do not actively monitor this. This is more a community forum. If you are a Sahi Pro user looking for commercial support, please email support @ sahipro.com with your query.

execute stored procedure in Sahi Pro

var $storedProcedure = "uspGetAllemployees(?, ?)";

var $callStoredProcedure = "{call "+$storedProcedure +"}";

var $driverName = "com.microsoft.sqlserver.jdbc.SQLServerDriver";

var $sqlServer = "QAserver";

var $DBName = "Employee";

var $username = "user";

var $password = "password";

var $jdbconnectionURL = "jdbc:sqlserver://"+$sqlServer+":1433;databaseName="+$DBName;

var $parameterArray = ["firstname", "lastname"];

java.lang.Class.forName($driverName);

$connection=java.sql.DriverManager.getConnection($jdbconnectionURL, $username, $password);

var $callableStatement= $connection.prepareCall($callStoredProcedure );

executeStoredProcedureParameters($callableStatement, $parameterArray);

function executeStoredProcedureParameters($callableStatement, $param){
for (var $i=0; $i<$param.length; $i++)
{
$callableStatement.setString($i+1, $param[$i]);
}
$callableStatement.execute();
}

..........................


Not working..
Any other solution ?
Sign In or Register to comment.