Connect to SQL Server from UNIX

If you are looking for how to connect to SQL Server from UNIX here are few simple steps to configure them

1) First Download n install the POD
2) Then you need to run this JDBC driver as init 3 service. The script is at /etc/rc3.d/S77spmf
Code of S77spmf
# Start/stop processes required for SPMF

case “$1” in
echo “Usage: $0 { start | stop }”
exit 1
exit 0
3) Copy these jar & properties files into a separate directory and start the JDBC service as given below in the script
/usr/bin/java -Xms64m -Xmx512m -Djdbc.drivers=$DRIVERS -Ddbd.port=9001 com.vizdom.dbd.jdbc.Server &
echo $JDBC_PID > /apps/iw-home/local/bin/spmf/db/
echo “Killing: `cat /apps/iw-home/local/bin/spmf/db/`”
kill -9 `cat /apps/iw-home/local/bin/spmf/db/`
4) Now connect to the JDBC port 9001 instead of the SQL Server port in the code
use DBI;
use DBD::JDBC;
my $dbh = DBI->connect( “dbi:JDBC:hostname=$host;port=9001;url=jdbc:sqlserver://tucgpsqlnp:1445″,”userid”,”password” ) or die print $DBI::errstr;
my $sql = “select DepartmentID from Department where DepartmentName like ‘$dept%'”;
$sth = $dbh->prepare($sql);
That’t it. Enjoy


Clear ComboBox in DCT

Since FormAPI doens’t have a method to clear the first NULL value in the dropdown, this workaround should work

var cmb = IWDatacapture.getItem(“/combo”);
var cmb_options = cmb.getOptions();
if (cmb_options != null) {
for (var i = 0; i<cmb_options.length; i++) {
cmb_options[i].selected = false;

Improve EventSubsystem Perfomance

If you don’t really use DataDeploy DAS use can comment out the following file from iw-home/httpd/webapps/eventsubsystem/WEB-INF/iw_bridge_cfg.xml

<logFile name=”TeamSiteClientDASLog”
isDAS=”true” />

<logFile name=”TeamSiteDASLog”
isDAS=”true” />


ssh without password

Here is a simple how-to on setting up ssh without password

1) Client%: ssh-keygen2
2) Client%: scp user@server:/$home/.ssh2/
3) Client%: vi identification and put in this line IdKey id_dsa_2048_a

1) Server%: Login as user
2) If .ssh2 directory doesn’t exist then create one under $home/.ssh2
3) Server%: vi authorization and put in this line Key

1) Client%: ssh user@Server

This should do the trick.

TeamSite Import Event

If you ever want to write some TeamSite triggers on Import Event, the event to capture is not CreateFSE or Lock. It’s RenameFSE, cos TeamSite before the file isimported create a new filename in temporary location. You need to capture ARGV[6] in your script to get the actual original filename. So in brief

Register the event
iwat RenameFSE /apps/xxxxx/script.ipl

In the script capture $import_rename = $ARGV[6];

Hope this helps.

Preview and Generate Error

The following error occurs when you try to preview a DCR.

Template Preview And Generate Error:

The following error occured while creating file
No such file or directory
The templated file was not generated.

Though you the user is part of the group that owns that directory, you might repeatedly and randomly get this error. Resolution to this, navigate to the preview-dir specified in your templating.cfg and delete all .nsf* files that reside on that location. Also make sure to delete zz_tst_username_*_manifest file located under /templatedata directory.

I have been going nuts on this issue. Hope it helps.